CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    George2 is offline Elite Member Power Poster
    Join Date
    Oct 2002
    Posts
    4,468

    release resource for WebClient class

    Hello everyone,


    I find there is no resource release method for WebClient class, e.g. a method called "Close".

    My usage scenario is,

    1. Creating a new instance of WebClient;
    2. Post byte[] data using UploadData method, and retrieve return data also using byte[].

    In my scenario, are there any need to call some methods to release the resource (I suepect there is request stream handle and response stream handle to release)?


    thanks in advance,
    George

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: release resource for WebClient class

    WebClient implements IDisposable (actually, its base class does). So, when you no longer need it, call Dispose().
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    George2 is offline Elite Member Power Poster
    Join Date
    Oct 2002
    Posts
    4,468

    Re: release resource for WebClient class

    Great cilu!


    Question answered.

    Quote Originally Posted by cilu
    WebClient implements IDisposable (actually, its base class does). So, when you no longer need it, call Dispose().

    regards,
    George

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured