好像无法监控read使用API吧,向高手请教

解决方案 »

  1.   

    dirWatcherGH = new FileSystemWatcher();dirWatcherGH.Path = "C:\\windows";
    dirWatcherGH.IncludeSubdirectories = false;
    dirWatcherGH.Filter = "*.txt";dirWatcherGH.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName;dirWatcherGH.Created += new FileSystemEventHandler(OnFileCreatedGH);
    OnFileCreatedGH是一个函数
    private void OnFileCreatedGH(object source, FileSystemEventArgs e)
    {}
      

  2.   

    谢谢楼上高人的指点
    我想要监听的是整个硬盘里的程序和文件夹
    path属性怎么设?没说清楚哈
      

  3.   

    dirWatcherGH.Path = "C:\\";
    dirWatcherGH.IncludeSubdirectories = true;一个FileWatcher只能监听一个盘吧
      

  4.   

    dirWatcherGH.Path = "C:\\";
    dirWatcherGH1.Path = "D:\\";
    dirWatcherGH2.Path = "E:\\";
    dirWatcherGH3.Path = "F:\\";
    分个来