Wince 5.0下进行的ftp上传操作出现问题了
private void PutFile(string filename)
{
FileInfo fileInf = new FileInfo(filename);
FtpRequestCreator creator = new FtpRequestCreator();
WebRequest.RegisterPrefix("ftp:", creator);
Uri testUri = new Uri(ftpURI);
FtpWebRequest reqFTP = (FtpWebRequest)WebRequest.Create(testUri+fileInf.Name);
reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
FtpWebResponse rpeFTP = (FtpWebResponse)reqFTP.GetResponse();
//int buffLength = 2048;
// byte[] buff = new byte[buffLength];
byte[] buff = new byte[fileInf.Length];
//int contentLen;
FileStream fs = fileInf.OpenRead();
fs.Read(buff, 0,Convert.ToInt32(fileInf.Length));
Stream strm = reqFTP.GetRequestStream();
strm.Write(buff, 0, buff.Length);
strm.Close();
fs.Close();
MessageBox.Show("File uploaded");
}