Time of Update: 2018-12-07
Excel檔案中第一個表名的預設值是Sheet1$, 但有時也會被改變為其他名字. 如果需要在C#中使用OleDb讀寫Excel檔案, 就需要知道這個名字是什麼.
Time of Update: 2018-12-07
using System.Windows.Forms;AxHostConverterCode highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
if (bool) { } else { }switch (v) { case v1: ... break; case v2: ... break; ... default: ... break; }do { } while (bool);while (bool) { }for (int i; i C# 的 switch 語句支援字串, 但好像只能用 const string 類型的變數.using System;class MyClass{ static void Main() {
Time of Update: 2018-12-07
假設我們要為某大學寫一個工資管理程式。首先是表示員工的 Employee 類(Employee.cs):01: namespace Skyiv.Ben02: {03: class Employee04: {05: public string Department { get; private set; }06: public string Name { get; private set; }07: public decimal Salary {
Time of Update: 2018-12-07
[C#]將數字前面補0,補足設定的長度 這是在小舖遇到的問題,如何將數字前面補0,補足設定的長度例如 將 123 前面補0,補到長度為6,可以透過 String.PadLeft 與 String.Format
Time of Update: 2018-12-07
堆棧(Stack)最明顯的特徵就是“先進後出”,本質上講堆棧也是一種線性結構,符合線性結構的基本特點:即每個節點有且只有一個前驅節點和一個後續節點。相對前面學習過的順序表、鏈表不同的地方在於:Stack把所有操作限制在"只能線上性結構的某一端"進行,而不能在中間插入或刪除元素。下面是:從中可以看出,堆棧有二種實現方式:基於數組的順序堆棧實現、類似鏈表的鏈式堆棧實現先抽象堆棧的介面IStack:namespace 棧與隊列{ public interface IStack<T>
Time of Update: 2018-12-07
文章目錄 .net工資管理系統 .net工資管理系統專為中心型連鎖銷售企業定製開發,已成功用於工資核算幾個月,系統穩定、易用。 功能簡介:一、簡潔靈活的部門及崗位設定,可快速尋找到特定員工。 二、基於運算式計算的工資項目,自動計算出員工的實發工資。 三、可匯出到工商銀行批量轉帳檔案及Excel表格檔案。四、對工資發放可完全定製員工及工資項。 五、更多請下載體驗。
Time of Update: 2018-12-07
首先我必須承認訪問一個類的私人成員不是什麼好做法。大家也都知道私人成員在外部是不能被訪問的。而一個類中會存在很多私人成員:如私人欄位、私人屬性、私人方法。對於私人成員訪問,可以套用下面這種非常好的方式去解決。private string name;public string Name{ get { return name; } set { name = value; }}
Time of Update: 2018-12-07
public void DataSet_Register(ref IStepProgressor pStepProgressor , ref IDataset pGISDataset ) { IEnumDataset pEnumDataset; IDataset pDataset; IVersionedObject pVersionedObject; try {
Time of Update: 2018-12-07
基於AE的個人地理資料庫(mdb格式)匯入到企業級資料庫(sde資料庫中,採用Oracle資料庫)中(C#).個人地理資料庫有資料集,匯入到企業級資料庫後沒有資料集,只有要素類。private void btnPGD2EGD_Click(object sender, EventArgs e) { try { string pWorkspaceName = strName;
Time of Update: 2018-12-07
本文旨在與各位朋友們分享我是如何在項目中用C# “ps圖片” 為網站產生同比例微縮圖的解決方案。如有不足之處歡迎您指出。 一、技術概述: 1.Ajax無重新整理上傳圖片,詳情請閱我的這篇文章。(jquery + c# ashx) 2.C#位元影像處理 System.Drawing。 3.最新demo支援IE7,IE8,FireFox。 二、微縮圖處理方法:
Time of Update: 2018-12-07
SOCKET:Socket介面介於應用程式與硬體之間。對Socket的理解可以簡化為:它是封裝了資料流(Stream)的從機器到機器的一條軟接線,通過這條軟接線,並藉助於線兩端的收發程式,網路上的機器間實現了資訊的交流與互連。分離在軟線兩端的應用程式(伺服器端程式和用戶端程式)可以通過調用Socket介面來開發具有TCP/IP網路功能的程式應用。作為用戶端,即要知道服務程式所在房間的房間號(IP地址),又要知道後門的位置(連接埠)。這樣才能正確地進入房間。 數據編發:軟線建立完成後,還必須有資
Time of Update: 2018-12-07
1. while 迴圈:#include <stdio.h>int main(void){ int i=0; while (i2. do while 迴圈:#include <stdio.h>int main(void){ int i=0; do { i++; printf("%d\n", i); } while (i3. while 與 do while
Time of Update: 2018-12-07
1. 常規:#include <stdio.h>int main(void){ int i; for (i = 0; i #include <stdio.h>int main(void){ int i; for (i = 0; i 4) printf("%d\n", i); else printf("*\n"); } getchar(); return 0;}2.
Time of Update: 2018-12-07
1. 傳值參數(非指標參數):#include <stdio.h>int inc(int x);int main(void){ int num = 1; printf("%d\n", inc(num)); /* 2 */ printf("%d\n", num); /* 1; num 並沒有改變, 用作函數參數時只是複製過去 */ getchar(); return 0;}int inc(int x) { x++;
Time of Update: 2018-12-07
1. 常規:#include <stdio.h>int main(void){ int i; for (i = 0; i 2. 省略 default:#include <stdio.h>int main(void){ int i; for (i = 0; i 3. 相同結果:#include <stdio.h>int main(void){ int i; for (i = 0; i 4. 用於字元:#include <
Time of Update: 2018-12-07
1. 運算結果超出類型大小:#include <stdio.h>#include <limits.h>int main(void){ short s1 = SHRT_MAX; short s2 = SHRT_MAX; short num1; int num2; /* 不會是期望的值 */ num1 = s1 + s2; printf("%d\n", num1); /* 這樣可以了 */ num2 = s1 + s2;
Time of Update: 2018-12-07
先複習函數的定義與函數的聲明://這是一個求和函數的定義:int add(int x, int y){ return(x + y);}//可以這樣聲明:int add(int x, int y);//也可以這樣聲明:int add(int, int);定義一個函數指標聲明一個函數差不多, 用 (* ) 包括函數即可://像這樣:int (*pfun)(int, int);//或這樣:int (*pfun)(int x, int y);//也可以:typedef int
Time of Update: 2018-12-07
本例:代碼:using System;class MyClass{ static void Main() { Console.WriteLine("sbyte 類型:"); sbyte sbyteVar = (sbyte.MaxValue + sbyte.MinValue) / 2; Console.WriteLine("{0}、{1}、{2}\n", sbyte.MinValue, sbyteVar, sbyte.MaxValue);
Time of Update: 2018-12-07
基本: . () [] x++ x-- new typeof checked unchecked -> ::一元: + - ! ~ ++x --x (T)x True False & sizeof乘除: * / %加減: + -移位: >關係: = is as 相等: == !=邏輯: & ^ |條件: && ||賦值: = += -= *= /= %= &= |=