Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
C# WebClient throws error while downloading a URL String
Sachin Ji
May 18 2017 9:41 AM
513
Reply
Hi,
A URL was working fine for last many months but suddenly stops working in C# but the same URL is working in Excel VBA using MSXML2.XMLHTTP60 request.
I tried Webclient and HTMLAgility but both fails in dowloading string from a web URL
private void webClienttry()
{
WebClient webClient = new WebClient();
string result = webClient.DownloadString("https://www.komplett.no/category/10448/tv?subcategory=11157_TV-er&hits=200");
Console.WriteLine(result);
}
Error:
System.Net.WebException: 'The underlying connection was closed: An unexpected error occurred on a send.'
IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Can anyone help me finding the cause of error.
Thanks
Regards/Sachin
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
How to replace id in url with some title.
I have a trouble with JSON Querryy