C#客户端WinForm如何自动(不许要用户选择文件)上传日志到Web服务器

C#客户端WinForm怎么自动(不许要用户选择文件)上传日志到Web服务器
C#客户端WinForm怎么自动(不许要用户选择文件)上传日志到Web服务器
1.WinForm客户端或者Web客户端能自动从某个设定的文件夹或文件上传到Web服务器;
2.上传的文件的大小在100kb之内;
3.最好是能简单点实现
WinForm自动上传 Web客户端自动上传 从固定文件夹上传文件 C#自动上传 客户端自动上传到服务器

------解决方案--------------------
1、服务端的IIS里建立FTP,要设置目录(可写入权限),用户名与密码,
2、写个FTP的类,网上很多,http://blog.csdn.net/hejialin666/article/details/3522815
3、timer1定时器加载FTP
简单代码如下:
using System.IO;
using System.Net;
  public static int UploadFtp(string filePath, string filename, string ftpServerIP, string ftpUserID, string ftpPassword)
        {
            FileInfo fileInf = new FileInfo(filePath + "\\" + filename);
            string uri = "ftp://" + ftpServerIP + "/" + fileInf.Name;
            FtpWebRequest reqFTP;            
            reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpServerIP + "/" + fileInf.Name));
            try
            {                
                reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
                reqFTP.KeepAlive = false;                
                reqFTP.Method = WebRequestMethods.Ftp.UploadFile;                
                reqFTP.UseBinary = true;
                reqFTP.ContentLength = fileInf.Length;
                int buffLength = 2048;
                byte[] buff = new byte[buffLength];
                int contentLen;
                FileStream fs = fileInf.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
                Stream strm = reqFTP.GetRequestStream();
                contentLen = fs.Read(buff, 0, buffLength);
                while (contentLen != 0)
                {
                    strm.Write(buff, 0, contentLen);
                    contentLen = fs.Read(buff, 0, buffLength);
                }                
                strm.Close();
                fs.Close();
                return 0;
            }
            catch (Exception ex)
            {
                reqFTP.Abort();                
                return -2;
            }