摘要:
EncodingEncoding类在System.Text名字空间中。using System;usingSystem.Text;usingSystem.IO;namespace Hello{ class Program { static void Main(string[] args) { string test = "Thisis our test string."; byte[] ascb; byte[] unicb; byte[] utfb; ascb = Encoding.ASCII.GetBytes(test); Console.WriteLine(" 阅读全文
摘要:
单件模式: 确保一个类只能创建一个实例,在全局中只有唯一的访问点。示例代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.Security.Cryptography;namespace Hello{ class Singleton { private int number = 0; private static SingletonuniqueInstance; private Singleton() { } publ.. 阅读全文