.NET: Do I need to keep a reference to WebClient while downloading asynchronously?

后端 未结 5 1010
没有蜡笔的小新
没有蜡笔的小新 2020-12-14 21:54

I use the following method in a piece of production code:

private void DownloadData(Uri uri)
{
    WebClient webClient = new WebClient();
    DownloadDataCom         


        
5条回答
  •  被撕碎了的回忆
    2020-12-14 22:27

    Flipside of the coin... if you stored a reference to the WebClient somewhere, just to see if it makes a difference... does that make the problem go away altogether? It may be easier to check it this way and be sure than to guess at what seems logical.

提交回复
热议问题