Sunday, August 29, 2010

Month 1: Visual Basic .NET

Every Sunday and Friday new tutorials will be posted. This month will be Visual Basic .NET.

Sunday August 29, 2010 - Programatically Connecting to the Web with VB.NET.

The method we are going to be using is Wrapping. Click here to download the custom wrapper coded by Ricky that we will be using for this project. >>RickysWrapper.vb

1. Create a new VB.NET project and add two textboxes and one button as shown below

2. Import the wrapper by clicking Project > Add Existing Item or by alternatively pressing Shift + Alt + A, and locate the downloaded wrapper.

3. Double click the button to access it's code and add the following:
        Dim wrapper As New RickysWrapper
        Dim HTML As String
        HTML = wrapper.GetRequest(TextBox1.Text, "")
        TextBox2.Text = HTML

Code Explained:
Line 1: By creating the variable "wrapper" you are creating a new instance of RickysWrapper thus making it usable.

Line 2: We created another variable here, this is where the html of the specified page will be stored.

Line 3: The wrapper will attempt to connect to the website entered in TextBox1, and the refer will be (refer is optional, you could just make it connect to the website.) The html will then be stored in the variable HTML

Line 4: The contents of the variable HTML will be shown in Textbox2

Step 5: Press F5 to run your program. Enter your URL in the first textbox then click the Connect button (remember to include ""

And that's it. You'll see that the HTML will be shown in Textbox2


  1. Ill be taking classes in programming so i'll defiantly be checking this out.

  2. wow this totally helped meout, thanks

  3. i used to do some cool stuff with vb...good time good times
    check out my blog please

  4. Always wanted to learn VB. I'm following and will be checkin' everyday for new content.

    See yer around :)