服务端生成的xml文件放在一个date的临时文件夹中,文件夹一般不会大于20M,然后现在要考虑网络状态的好坏,以及多线程的情况.客户端将这个文件夹下载到本地目录system下.下载完。发送socket命令(这个不用实现)删除服务端的那个临时文件夹请教下服务端和客户端如何写代码.传输方式指定为ftp的模式.

解决方案 »

  1.   

    那就自己直接实现下FTP客户端 服务器端用FTP服务端软件
      

  2.   

    [code=C#]Cursor currentCursor = this.Cursor;
                FtpWebResponse response = null;
                Stream stream = null;
                try
                {
                    this.Cursor = Cursors.WaitCursor;                //Create the FtpWebRequest object
                    FtpWebRequest request = (FtpWebRequest)WebRequest.Create(textBoxServer.Text);
                    request.Credentials = new NetworkCredential(textBoxUserName.Text, textBoxPassword.Text);
                    request.Method = WebRequestMethods.Ftp.ListDirectory;                //Send the request to the server
                    response = (FtpWebResponse)request.GetResponse();                //read the response and fill the list box
                    stream = response.GetResponseStream();
                    FillDirectoryList(stream);                serverDirectory = null;
                    buttonOpenDirectory.Enabled = false;
                    buttonGetFile.Enabled = false;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error FTP Client", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                finally
                {
                    if (response != null)
                        response.Close();
                    if (stream != null)
                        stream.Close();
                    this.Cursor = currentCursor;
                }[code]
    借用一下《c#入门基础》书上的一个例子。
    以上是主要代码。
      

  3.   

    参考C# WinForm开发系列 - Socket/WCF/Rometing/Web Services