implementating idispose of webresponse.

  • Thread starter Thread starter trialproduct2004
  • Start date Start date
T

trialproduct2004

hi all
can some one tell me how to call dispose method of webresponse.
I am currently using close method.
But this is creating problem. So i want to use dispose method of
webresponse.
Can some one tell me how to do this.

Any help will be appreciated.
thanks in advance.
 
Hi,

What's the exact problem with using the Close method (use of which is
recommended by Microsoft in the MSDN docs)?
 
hi
problem is at a time of calling close on webresponse,sometime my
program is blocking.
it is not throwing exception not executing next statement.
Because of which my whole application is collapsing.
This is vary serious problem for me.
In one link i read that close ia blocking program.
I don't know why this is happening.
So i though that may be dispose will solve my problem.

Thanks.
 
can some one tell me how to call dispose method of webresponse.
I am currently using close method.
But this is creating problem. So i want to use dispose method of
webresponse.
Can some one tell me how to do this.

Well, if you're always calling Close, it should be okay. However, you
should just be able to do:

using (WebResponse resp = ...)
{
...
}
 
Back
Top