请问怎样将本地的一个文件复制到远程计算机上!

解决方案 »

  1.   

    那你需要两者之间建立传输方式。
    例如ftp之类。
      

  2.   

    Remote 完全可以做到這個效果.
      

  3.   

    我长用 pscp 把本地文件传到 linux 服务器上,  
    pscp f:\dir\file1 [email protected]:/tmp不知道是通过什么协议?好象是SSH吧
      

  4.   

    先建立授权访问,
    使用WMI
    using System;
    using System.Management;class Sample_ConnectionOptions
    {
        public static int Main(string[] args) {
            ConnectionOptions options = new ConnectionOptions();
            options.Username = 用户名; //could be in domain\user format
            options.Password = 密码;
            ManagementScope scope = new ManagementScope(
                "\\\\servername\\root\\cimv2",
                options);
            try {
                scope.Connect();
                ManagementObject disk = new ManagementObject(
                    scope,
                    new ManagementPath("Win32_logicaldisk='c:'"),
                    null);
                disk.Get();
                //接着就可以拷文件了,就象在本地操作一样,不过要加上网络路径
                File.Copy(@"\\remotepc\c:\te.txt","c:\\te1.txt");
            }
            catch (Exception e) {
                Console.WriteLine("Failed to connect: " + e.Message);
            }
            return 0;
        }
    }再复制文件,
    http://blog.csdn.net/zhzuo/archive/2005/03/08/315125.aspx