Donate

Using Proxy With WebClient In VB.NET

Here is a snippet to use WebProxy. This is useful for scraping or other webrequest activities.
Dim webclient As New System.Net.WebClient  
       Try  
        'true for bypassOnLocal  
        webclient .Proxy =   
             New System.Net.WebProxy("180.95.129.232:80",true)  
        wc.OpenRead("http://yoursite.com")  
        lblStatus.Text = "ok"   
       Catch  
        lblStatus.Text = "error proxy"  
      End Try  

Comments

  1. when I'm using a list of proxy
    xxx.xxx.xxx.xxx:xxxx
    xxx.xxx.xxx.xxx:xxxx
    xxx.xxx.xxx.xxx:xxxx
    xxx.xxx.xxx.xxx:xxxx
    ...
    ...

    - only first proxy returns "ok"
    other items in this list are not working.

    ReplyDelete

Post a Comment

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.

Invalid nested tag div found, expected closing tag input