Kavitha Anbalagan

Hi,

I am using OpenNETCF.Net.Ftp for the File Transfer using FTP. While trying by Emulator, it returns 'A socket operation encountered a ded network' exception.

When I tried that in the device, 'No such host is known' exception occurs. I have given the correct host address, username and password. I have given port number as 21. Is there any problem in the port number

What and Where may be the problem

Thanks.



Re: Smart Devices VB and C# Projects File Transfer using FTP

Hammadi Dali



Hi
try to have a look to this post
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=89964&SiteID=1

Is it helpful

Regards
Hammadi




Re: Smart Devices VB and C# Projects File Transfer using FTP

Kavitha Anbalagan

Hi,

I referred that URL. But I cant even connect to the server.

I have used the same code:

public void connect()

{

FtpRequestCreator creator = new FtpRequestCreator();

WebRequest.RegisterPrefix("ftp:", creator);

try {

// Building our URI object

Uri testUri;

// Building our URI object

testUri = new Uri("ftp://" + this.host + dir);

// Creating a new FtbRequest object

this.request =(FtpWebRequest)WebRequest.Create(testUri);

this.request.Credentials = new NetworkCredential(this.user, this.password);

// Getting the Request stream

ftpRequestStream = request.GetRequestStream();

//

StreamReader reader = new StreamReader(ftpRequestStream);

this.responseFTP = reader.ReadToEnd();

// Conected

this.logined = true;

// Change Folder

this.changedir(this.dir);

}

catch (Exception ex) {

string error= ex.Message.ToString();

ftpRequestStream = null;

this.logined = false;

}

}

It returns 'No such host is known' or Error Code:11001.

Is there anything i have to change in the Settings

Thanks.





Re: Smart Devices VB and C# Projects File Transfer using FTP

Guang-Ming Bian - MSFT

Hi Kavitha Anbalagan,

Please look at the line code:

testUri = new Uri("ftp://" + this.host + dir);

Your problem is in the line code, Now your host path is the combination of this.host and dir, it's not only host,

So you should write like:

testUri = new Uri("ftp://" + this.host+"/" + dir);

It will work fine.

Best regards,

Guang-Ming Bian - MSFT