NickLi

导航

2011年3月25日 #

请使用C#的文件流来拷贝文件

摘要: 用File.Copy拷贝了一个Excel文件,打开后发现丢掉了许多sheets.之后发现用文件流来拷贝还是比较靠谱的, 代码很简单:private static void TestFileCopy(string sourcePath, string destiPath) { FileStream fs = new FileStream(sourcePath, FileMode.Open, FileAccess.Read, FileShare.Read, 1024, false); System.IO.BinaryReader br = new System.IO.BinaryReader(fs 阅读全文

posted @ 2011-03-25 10:34 孤叶无眠 阅读(583) 评论(0) 推荐(0) 编辑