Solved

C#.NET FTP Request Error

Posted on 2008-10-21
6
706 Views
Last Modified: 2012-05-11
I am running the following code:

//Set up the FTP connection
FtpWebRequest ftpRequest = (FtpWebRequest)WebRequest.Create(strFtpUri);
ftpRequest.Credentials = new NetworkCredential(strFtpLogin, strFtpPassword);

//Initiate the request and read the response
FtpWebResponse ftpResponse = (FtpWebResponse)ftpRequest.GetResponse();
Stream ftpResponseStream = ftpResponse.GetResponseStream();
StreamReader reader = new StreamReader(ftpResponseStream, System.Text.Encoding.UTF8);

This works fine on my client but when I run it on Windows Server 2008 I recieve an error @ line:
--  FtpWebResponse ftpResponse = (FtpWebResponse)ftpRequest.GetResponse();

The error states "The Remote Name Could Not Be Resolved".  Any ideas?
0
Comment
Question by:CipherIS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 1

Author Comment

by:CipherIS
ID: 22767702
I think the issues is Windows Server 2008 is not allowing connection to the FTP site.  Will check.
0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 22768505
the following link gives a perfect coding sample fo ftp file upload and download
i am already using the code from this sample in my windows service on windows 2008 server
hope it helps
https://secure.codeproject.com/KB/IP/SimpleFTPDemo.aspx
0
 
LVL 1

Author Comment

by:CipherIS
ID: 22768704
Nope.  Still does not work.
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 1

Author Comment

by:CipherIS
ID: 22768727
Nope.  Still does not work.  Works on the client but on Windows Server 2008 it is not working.  Any ideas?
FTP-Error.JPG
0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 22770883
can you please share your code and the parameters you are passing to connect to the ftp website
the error says could not resolve ftp - to me it means that you are just passing ftp as the ftp site name and not the fully qualified name
more details will definitely help
0
 
LVL 1

Accepted Solution

by:
CipherIS earned 0 total points
ID: 22786222
It was the set up of the Windows 2008 server that prevented the FTP connection.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question