Tag Info

New answers tagged

1

In most examples online however, this is exactly what's done Not sure how; neither WebRequest nor its concrete descendant HttpWebRequest do in fact implement IDisposable, so this using (System.Net.WebRequest wr = new System.Net.HttpWebRequest()) { //What? } does not compile. In fact what I find when I google around this topic is mostly ...


3

My question is then, how do I know specifically which classes need to be disposed? Does it implement IDisposable? Yes? Then it needs to be disposed. If not, not. You can maybe get away without it in some apps (C# and modern operating systems in general are better about cleaning up after you), but it is still wrong®. There are a very few framework ...



Top 50 recent answers are included