做一个winform程序,选择一个文件夹,让后把这个文件夹上传的ftp服务器上,谁做过么

解决方案 »

  1.   

    ftp服务端和客户端都是你开发的。想怎么存,看你高兴了。你高兴存一个文件夹就存一下。不高兴都存成一个文件也行。
      

  2.   

    socket通讯就可以了,类似IPMESSAGER.
      

  3.   

    我有ftp的地址 用户名 和密码
    我现在能上传单个文件了怎么在服务器上创建文件夹呢?需要保持上传文件夹的目录结构
    WebRequestMethods.Ftp.MakeDirectory;这个能用么;
      

  4.   

    问题已经解决,参考资料如下 希望对大家有帮助
    http://topic.csdn.net/u/20100521/15/4a2d8a78-199f-4ca9-a0ce-73630b0ff123.html /// <summary>
     /// 在ftp上创建文件夹
     /// </summary>
     /// <param name="ftpser"></param>
     /// <returns></returns>
      public bool MakeDir( string ftpser)
      {
        try
        {
          Uri uri = new Uri(ftpser);
          //创建和FTP的连接 GetRequest是连接的方法 上面地址里面有
          System.Net.FtpWebRequest reqFtp = GetRequest(uri.ToString(), 
                                                "username","pass");
          reqFtp.Proxy = null;
            
           reqFtp.Method = WebRequestMethods.Ftp.MakeDirectory;
          reqFtp.UseBinary = true;      FtpWebResponse response = reqFtp.GetResponse() as FtpWebResponse;
          response.Close();
         }
         catch
         {
           return false;             
         }
             return true;
       }