是否有处置废弃的HttpWebRequest的正确方法是什么? [英] Is there a correct way to dispose of a httpwebrequest?

查看:351
本文介绍了是否有处置废弃的HttpWebRequest的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是的HttpWebRequest ,和我处理响应流中。是否有处置的正确方法的HttpWebRequest ,因为它不包含关闭或Dispose方法?

I am using a HttpWebRequest, and am disposing of the response stream. Is there a correct method of disposing of the HttpWebRequest, as it does not contain a close or dispose method?

推荐答案

如果这个类有特殊的处理要求,它会实现了IDisposable。因为它没有实现IDisposable,你可以假设没有什么特别的你需要做的。

If the class had special disposal requirements, it would have implemented IDisposable. Since it doesn't implement IDisposable, you may assume there's nothing special you need to do.

这篇关于是否有处置废弃的HttpWebRequest的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆