随笔分类 -  .NET

C#中一些字符串操作的常用用法
摘要:<!--StartFragment-->//获得汉字的区位码  byte[] array = new byte[2];  array = System.Text.Encoding.Default.GetBytes("啊"); int i1 = (short)(array[0] - ''\0'');  int i2 = (short)(array[1] - ''\0'');//unico... 阅读全文
posted @ 2006-05-08 16:55 leithon 阅读(185) 评论(0) 推荐(0)
序列化
摘要:序列化:1、定义结构[Serializable()]public struct structname{...}2、序列化public static byte[] ObjectToByteA(object obj){MemoryStream fs = new MemoryStream();byte[] tmp = null;try {// 序列化BinaryFormatter formatter =... 阅读全文
posted @ 2006-05-08 16:24 leithon 阅读(287) 评论(0) 推荐(0)