473,378 Members | 1,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

unhandled exception : System.net.webException

Hi,
I am using a C# console appliaction to FTP a file from Windows to Unix. Here i am using the following code :

Expand|Select|Wrap|Line Numbers
  1. FtpWebRequest request = (FtpWebRequest)WebRequest.Create(myUri);
  2. request.Method = WebRequestMethods.Ftp.UploadFile;
* myUri is the URI for my Unix machine

I am getting an error of
System.Net.WebException : The remote name could not be resolved : 'myUri'

Kindly suggest some pointers in resolving the error.
Thanks in advance!
Mar 26 '12 #1
4 3791
Frinavale
9,735 Expert Mod 8TB
It would help if you posted the declaration code for myUri since the exception is indicating that this code is incorrect.

-Frinny
Mar 26 '12 #2
The code for myUri is :

Expand|Select|Wrap|Line Numbers
  1. Uri newUri = new Uri("ftp://www.xyz.com");
i can write the URI directly in the ".Create()" method as well, i have just taken it as "newUri" for convenience
Mar 27 '12 #3
Frinavale
9,735 Expert Mod 8TB
The error is stating that the web request couldn't be made because it could not resolve the URL that you've provided.

Are you sure that "ftp://www.xyz.com" exists?
It can't be resolved.

-Frinny
Mar 27 '12 #4
Thanks Frinny!..
Yes the ftp link does exist..i will try with the ip address for ftp and check for the working..
Mar 29 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: DelboyJay | last post by:
I have found a strange resource problem, but luckily I have also found the solution which was not obvious from the runtime exception. I really think that the compiler should pick up this problem...
0
by: Joe Bloggs | last post by:
I have a C# MRS application that uses the ReportingService's Render method to retrieve a byte array containing a report. The following error message occurs An unhandled exception of type...
3
by: nick | last post by:
The program runs well on Local harddisk. But it always popup the exception if I run it on Netware mapping disk. After debugger say there is no source code on the exception. Also the following error...
2
by: Ray5531 | last post by:
I have .netframework 1.1 and IIS 5.1 installed on my Windows xp.When I try to run my applicatin either from Internet Explorer or from VS 2003,A just-in-time debugger instance pops up and says that...
7
by: Chuck Hartman | last post by:
I have a Windows service that requests web pages from a site using an HttpWebRequest object. When I try to request a page from an ASP.NET 2 site, I get a WebException with message "The remote...
1
by: mike | last post by:
My program is crashing, but it doesn't crash on a single line of code. Below is what the output tab displays. I have no idea where to start inorder to debug this problem. Is there any suggesstions...
1
by: Parag Mahajan | last post by:
Hello, I am using VS.Net 2003 1.1 framework. I have a VB.Net client project consuming Axis 1.1 web service. Whenever I try to create an instance of the WebService, I get the following...
3
by: James | last post by:
Hi guys Do you ever get the exception in Managed C++? How can I know which file or dll is missed?
0
by: Jerry T. | last post by:
I have the following code (using VB.NET 2003 with Framework 1.1): Protected Shared Sub RetrieveURLData() Dim HttpReq As WinHttp.WinHttpRequest Dim strText As String Try ' Create the...
4
by: nightcoder | last post by:
i am currently trying to run a web crawler through the terminal. it compiles fine and the debug does not find any errors, however i get the following error which i do not under stand. any ideas on...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.