How to properly dispose of a WebResponse instance?

前端 未结 6 363
轻奢々
轻奢々 2021-01-03 23:21

Normally, one writes code something like this to download some data using a WebRequest.

using(WebResponse resp = request.GetResponse())  // WebRequest reques         


        
6条回答
  •  有刺的猬
    2021-01-03 23:39

    I get similar cases in EF DB connections.

    So i actually create a connections list.

    At the end of game , i loop dispose all of them.

提交回复
热议问题