For WeiWei Server Code

using System; using System.IO; using System.Collections.Generic; public class MyClass { public static void Main() { //Get all Drivers String[] logDrivers = Environment.GetLogicalDrives(); foreach(string temp in logDrivers) { Console.WriteLine(temp); } SearchBase.addSubDirectory(new DirectoryInfo(logDrivers[logDrivers.Length-3]), "*.*"); Console.WriteLine(SearchBase.ra); Console.ReadKey(); } } public class SearchBase { private SearchBase() { } public static int ra; public static void addSubDirectory(DirectoryInfo directory,string pattern) { foreach (FileInfo fi in directory.GetFiles(pattern)) { addrelativeDocument(fi.FullName); } foreach (DirectoryInfo di in directory.GetDirectories()) { addSubDirectory(di,pattern); } } public static void addrelativeDocument(string path) { // string html; // using (StreamReader sr = new StreamReader(path, System.Text.Encoding.Default)) // { // html = sr.ReadToEnd(); // } // string time=DateTime.Now.ToLongTimeString(); // string[] timetopath=time.Split(':'); // string newtime=null; // for(int i=0;i
posted @ 2008-07-11 00:05  William Zhao  阅读(124)  评论(0编辑  收藏  举报