摘要: 我们有时需要遍历某个目录下的文件和子目录,可以使用System.IO.DirectoryInfo.GetDirectories或 GetFiles来获得目录下的所有的文件和子目录,当这个目录下的内容比较多时,这个操作就比较耗时间,有时我们仅仅需要知道某个目录下是否有子目录, 这样的操作显然是浪费时间的。此时我们很容易想到三个Win32API函数 FindFirstFile,FindNextFile... 阅读全文
posted @ 2008-10-07 14:56 AlexusLi 阅读(716) 评论(0) 推荐(0) 编辑
摘要: public ArrayList al=new ArrayList(); //我把ArrayList当成动态数组用,非常好用 public void GetAllDirList(string strBaseDir) { DirectoryInfo di=new DirectoryInfo(strBaseDir); DirectoryInfo[] diA=di.GetDirecto... 阅读全文
posted @ 2008-10-07 14:45 AlexusLi 阅读(2826) 评论(0) 推荐(0) 编辑
摘要: C#追加文件 StreamWriter sw = File.AppendText(Server.MapPath(".")+"""myText.txt"); sw.WriteLine("追逐理想"); sw.WriteLine("kzlll"); sw.WriteLine(".NET笔记"); sw.Flush(); sw.Close(); C#拷贝文件 string OrignFil... 阅读全文
posted @ 2008-10-07 13:55 AlexusLi 阅读(326) 评论(1) 推荐(0) 编辑