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
Robert RaboudPosted May 18, 2017, 10:23 AM
string result = webClient.DownloadString("https://www.komplett.no/category/10448/tv?subcategory=11157_TV-er&hits=200");
Console.WriteLine(result);
Atta KumahPosted May 22, 2020, 4:50 AM
Uwe KeimPosted Sep 2, 2018, 3:02 PM
Dao HuongPosted Aug 16, 2018, 12:43 PM
Johnson APosted Jun 6, 2018, 8:06 AM