我想实现这么个功能;
假设,我要搜索一个文件叫 QQ.exe。但又不知道它的路径。我要全盘的搜索它,要怎么实现。
从DriveInfo[] di = DriveInfo.GetDrives();开始,我要怎么去实现搜索功能。

解决方案 »

  1.   

    你们回答的都不是重点,怎么才能最快的找到我想要的是很简单,我会。
    从DriveInfo[] di = DriveInfo.GetDrives();开始,我要怎么去实现搜索功能。
    关键是这个。我不知道为什么用不了。也就是说,我引用了IO。但这个类还是引用不了。
      

  2.   

    如果你有4个硬盘分区,不妨执行四个DriveInfo[] di = DriveInfo.GetDrives();进程
    即DriveInfo[] di1 = DriveInfo.GetDrives();
    DriveInfo[] di2 = DriveInfo.GetDrives();
    DriveInfo[] di3 = DriveInfo.GetDrives();
    DriveInfo[] di4 = DriveInfo.GetDrives();
      

  3.   


    恩!太慢了@  
    string[] mylist = System.IO.Directory.GetDirectories(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "*.*", System.IO.SearchOption.AllDirectories);