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
文章目錄 .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
在《重構》之Split Temporary Variables中,要使用到final這個類型。由於例子是用java寫的,於是我想找到c#中對應final的修飾符。結果找到了兩個:const和readonly下面看看這兩個有什麼區別:· readonly和const都是用來標識常量的[1]。· const可用於修飾class的field或者一個局部變數(local variable);而readonly僅僅用於修飾class的field。·
Time of Update: 2018-12-07
在此,以添加"aricc”協議為例。一、首先,編寫一個支援aricc協議的程式。我們就使用C#來寫一個樣本程式吧。1、建立一個windows應用程式。2、在Form表單上添加一個TextBox控制項。3、修改Form.cs代碼為如下所示: public partial class Form1 : Form { public string cmd; public Form1() { InitializeComponent(
Time of Update: 2018-12-07
ArcGIS Engine二次開發一般需要通過案頭產品來製作這些符號,然後通過專門的轉換工具轉換以後供AE使用。電力GIS應用當中,電力裝置種類繁多,裝置狀態比較複雜,需要用不同的符號來表現電力裝置的不通狀態,此外電力技術的更新速度很快,新裝置種類也不斷推陳出新,使用者往往要求提供符號定義工具以滿足這些需求。本文以配電變壓器為例,介紹一種使用ArcGIS Engine + C#二次開發模式下,可以讓使用者自己定義裝置符號的一種方法。一、符號定義配電變壓器符號如所示:可以將這個符號分解成四個圖元,
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
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/// <summary> /// 列印輸出.該功能目前測試只適用於JPEG,BMP.格式 /// </summary> /// <param name="pExport"></param> ///
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
C 語言資料類型: 基本類型、構造類型、指標類型、空類型.基本類型又包括: 整型、字元、浮點(單精確度、雙精確度)、枚舉.構造類型又包括: 數組、結構體、公用體.1. 顯示整型(int)的最小、最大值:#include <stdio.h>#include <limits.h>int main(void){ int n1,n2; n1 = INT_MIN; n2 = INT_MAX; printf("%d .. %d", n1,n2);
Time of Update: 2018-12-07
非指標參數(也就是傳值參數)不會被修改原始值, const 對它是沒有意義的.const 只用於指標.1. 第一種用法: const 類型 *變數:這種用法將限制修改指標指向的值.#include <stdio.h>int fun(const int *p) { *p += 1; /* 只有去掉 const 這句才可以執行 */ return *p;}int main(void){ int num = 3; printf("%d\n", fun(&
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 相等: == !=邏輯: & ^ |條件: && ||賦值: = += -= *= /= %= &= |=