編碼|規範 一、匈牙利命名法: Windows 編程中用到的變數(還包括宏)的命名規則匈牙利命名法,這種命名技術是由一位能乾的 Microsoft 程式員查爾斯·西蒙尼(Charles Simonyi) 提出的。匈牙利命名法通過在變數名前面加上相應的小寫字母的符號標識作為首碼,標識出變數的範圍,類型等。這些符號可以多個同時使用,順序是先m_(成員變數),再指標,再單一資料型別,
怎麼樣?答案是這樣的s1 is A strings2 is A strings1 is now Anothing strings2 is now string看到這個結果大家感覺怎麼樣!我是很感到意外的。因為根據原來的C實現字串的方式,在這裡面作為一個指標來說,s1與s2應該指向相同的地址。另外對於字串處理還有另一個問題,如下例:要構建如下一個串:"C:\PROGRAM FILE\WOM",我想大家明白我的意思了吧!就是說在這裡有 \ 但是 \
對話方塊 按行讀寫檔案判斷檔案是否存在:File.Exists(string filePath)判斷目錄是否存在:Directory.Exists("D:\\LastestVersion")按行讀取檔案: int fileCount=0; // Open the file just specified such that no one else can use it. StreamReader sr = new
1.14 PropertiesA property is a named attribute associated with an object or a class. Examples of properties include the length of a string, the size of a font, the caption of a window, the name of a customer, and so on. Properties are a natural
封裝|加密|解密 using System;using System.Text;using System.Globalization;using System.Security.Cryptography; using System.Windows.Forms;namespace Jh.Encrypts{ public class JhEncrypt { /// <summary> /// 構造方法 ///