having problem to translate from WinForm to Windows-CE C# program - FTP transfer
-
having problem to translate from WinForm to Windows-CE C# program - FTP transfer i have this code for transfer from Local computer to FTP server its work excellent on WinForm, i must have this on Windows-CE and it dosnt work the code: string MyFile = @"d:\PC.sdf"; string url = "ftp://127.0.0.1/PC.sdf"; FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(url); request.Method = WebRequestMethods.Ftp.UploadFile; //request.Credentials = new NetworkCredential("user name", "password"); request.UsePassive = true; request.UseBinary = true; request.KeepAlive = false; //byte[] buffer = File.ReadAllBytes(MyFile); using (Stream reqStream = request.GetRequestStream()) { int count = 0; byte[] buffer = new byte[100]; using (FileStream file = new FileStream(MyFile, FileMode.Open)) { while ((count = file.Read(buffer, 0, 100)) > 0) { reqStream.Write(buffer, 0, count); } } } thanks in advance
-
having problem to translate from WinForm to Windows-CE C# program - FTP transfer i have this code for transfer from Local computer to FTP server its work excellent on WinForm, i must have this on Windows-CE and it dosnt work the code: string MyFile = @"d:\PC.sdf"; string url = "ftp://127.0.0.1/PC.sdf"; FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(url); request.Method = WebRequestMethods.Ftp.UploadFile; //request.Credentials = new NetworkCredential("user name", "password"); request.UsePassive = true; request.UseBinary = true; request.KeepAlive = false; //byte[] buffer = File.ReadAllBytes(MyFile); using (Stream reqStream = request.GetRequestStream()) { int count = 0; byte[] buffer = new byte[100]; using (FileStream file = new FileStream(MyFile, FileMode.Open)) { while ((count = file.Read(buffer, 0, 100)) > 0) { reqStream.Write(buffer, 0, count); } } } thanks in advance
What error messages are you getting? On WinCE devices you might not have "d:" so check that.
Its the man, not the machine - Chuck Yeager If at first you don't succeed... get a better publicist