远程服务器共享文件夹在本地映射了一个驱动器后,需要把本地的文件复制进去,并且需要验证用户名密码才可以登陆那个共享文件夹谁知道怎么做?

解决方案 »

  1.   

    string wl= "net use \\192.168.1.1\共享名 密码 /user:登录用户名"; Process 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(wl); p.StandardInput.WriteLine("exit"); p.Close(); 然后开始复制到 上面的共享文件夹下
      

  2.   

    映射网络驱动器
    --------》
    http://topic.csdn.net/t/20050810/07/4199512.html
    用API实现的
      

  3.   

    你已经用net use 连接上机器了
    为什么要映射驱动器??直接访问就可以了你也可以用WMI获得共享目录~~~~~