//192.168.1.2/input 这个目录已共享,访问账号abc/123
如何才能把本地机器上,如c:\\1.txt文件拷贝到//192.168.1.2/input 中去呢?

解决方案 »

  1.   

    上传啊
    看这个
    http://dotnet.aspx.cc/ShowDetail.aspx?id=58EA3515-36F2-4FD9-AC89-EAF49F59816C
      

  2.   

    用c#的dos调用net use \\192.168.1.2 "123" /u:"abc"
    copy c:\\1.txt \\192.168.1.2\input
      

  3.   

    用c#的dos调用net use \\192.168.1.2 "123" /u:"abc"//第一个cmd
    copy c:\1.txt \\192.168.1.2\input//第二个cmd
    你可以存为arraylist,循环处理
    public string cmd(string cmd)
    {
    System.Diagnostics.Process p=new System.Diagnostics.Process();
    p.StartInfo.Arguments="cmd/c "+cmd;
    p.StartInfo.RedirectStandardError=true;
    p.StartInfo.RedirectStandardInput=true;
    p.StartInfo.RedirectStandardOutput=true;
    p.StartInfo.UseShellExecute=false;
    p.Start(); return p.StandardOutput.ReadToEnd();
    }
      

  4.   

    提示出错呢?
    Cannot start process because a file name has not been provided
      

  5.   

    我把网络中共享的文件映射为服务器本机上的一个驱动器,
    在命令行项目中使用file.copy通过
    但是换成asp.net项目,作为button的click事件,file.copy就报错,这是什么原因呢?
    哪位高手指点下吧?
      

  6.   

    应该不是权限问题,命令行app中都通过