如何获取windows下共享目录
谢谢

解决方案 »

  1.   

    或者用Process执行这个 net view IP地址
      

  2.   

    使用如下代码执行DOS命令: net share > c:\1.txtProcess p = new Process();
    p.StartInfo.FileName = "cmd.exe";p.StartInfo.UseShellExecute = false;
    p.StartInfo.RedirectStandardInput = true;
    p.StartInfo.RedirectStandardOutput = true;
    p.StartInfo.RedirectStandardError = true;
    p.StartInfo.CreateNoWindow = true;
    p.Start();
    p.StandardInput.WriteLine("net share > c:\\1.txt");
    p.StandardInput.WriteLine("exit");
    p.StandardOutput.ReadToEnd();然后再用代码分析c:\1.txt即可
      

  3.   


    HKLM\SYSTEM\CurrentControlSet\Services\lanmansever\Shares下好像有。
    但不知道准不准。