Hi,
I am using "opennetcf.net.ftp library" for uploading a file to FTP server from .net windows mobile application. I am using the following code. It is connecting to server but I am getting a error saying that'
using OpenNETCF.Net.Ftp;
string fileName = "sample.txt";string ip; string username; string password
string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
FileInfo fileInf = new FileInfo(path + "\\" + fileName);
FtpRequestCreator creator = new FtpRequestCreator();
WebRequest.RegisterPrefix("ftp:", creator);
Uri testUri;
if (ip.IndexOf("ftp:") != 0)
testUri = new Uri("ftp://" + ip);
else
testUri =
new Uri(ip);
reqFTP = (FtpWebRequest)FtpWebRequest.Create(testUri);
//reqFTP.UseDefaultCredentials = false;
reqFTP.Credentials = new NetworkCredential(username, password);
FileStream
fs = fileInf.OpenRead();
while (contentLen != 0)
{
strm.Write(buff, 0, contentLen);
contentLen = fs.Read(buff, 0, 2048);
}
strm.Close();
fs.Close();
Please let me know what I am missing in this code
Thanks