Fly
Believe Me I Can Fly , I Am Singing In The Sky
07 2012 档案
正则表达式与抓取是网页图片
摘要:正则表达式 命名空间:using System.Text.RegularExpressions; 常用的类: Regex MatchCollection Match Group GroupCollection 常用的方法: Regex.IsMatch(); 返回值bool Regex.Match(); 返回值Match Regex.Matches(); 返回值MatchCollection ... 阅读全文
posted @ 2012-07-06 23:07 梁彦伟 阅读(422) 评论(1) 推荐(0)
简单介绍二进制序列化和深拷贝
摘要:获得当前路径的方法:1Directory.GetCurrentDirectory(); //注意:====不推荐使用=== 此方法确实能过的文件的路径。但是肯能会被改动。 例: string path = Directory.GetCurrentDirectory(); Console.WriteLine(path); Console.ReadKey(); //结果:"D:\lianxi\作业\深考与浅考\bin\Debug" Directory.SetCurrentDirectory(@"R:\"); string path = D... 阅读全文
posted @ 2012-07-04 23:05 梁彦伟 阅读(209) 评论(0) 推荐(0)
二进制序列化简单介绍
摘要:二进制序列化: 序列化就是将对象从内存中移到硬盘(使用FileStream)或者向网络(使用NetWorkStream)中传送。可认为是格式化数据。 1 使用时先添加命名空间: using System.Runtime.Serialization.Formatters.Binary; 2 BinaryFormatter bf = new BinaryFormatter(); 实例化 3 使用 [Serializable] 标记,将它添加到要序列化的对象上; 例1:[Serializable] class Person { public int Num; public st... 阅读全文
posted @ 2012-07-03 23:06 梁彦伟 阅读(349) 评论(0) 推荐(0)
文件操作常用相对类File ,FileStream, Directory, Path
摘要:文件操作常用相对类:File // 操作文件,静态类。FileInfo //文件类,用来描述一个文件对象,(获取指定目录下的所有文件,返回一个数组) Directory //操作目录(文件夹),静态类。DirectoryInfo //文件夹的一个“类”,用来描述一个文件夹(目录)对象。返回一个DirectoryInfo数组,其用法与Directory相似。Path // 对文件路径的操作。Stream // 文件流,抽象类 FileStream // 文件流 MemoryStream//内存流 NetWorkStream//网络流 StreamReader ... 阅读全文
posted @ 2012-07-02 23:58 梁彦伟 阅读(640) 评论(0) 推荐(0)