..The underlying connection was closed: An unexpected error occurred on a receive

前端 未结 8 552
一个人的身影
一个人的身影 2020-11-28 06:49

I have the following code:

private Uri currentUri;

private void Form1_Load(object sender, EventArgs e)
{
    currentUri = new Uri(@\"http://www.stackoverflo         


        
8条回答
  •  有刺的猬
    2020-11-28 07:37

    I was working also on web scraping project and same issue found, below code applied and it worked nicely. If you are not aware about TLS versions then you can apply all below otherwise you can apply specific.

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
    

提交回复
热议问题