• home
  • forum
  • my
  • kt
  • download
  • How to view your local IP

    Author: 2008-09-13 09:34:42 From:

    When you've done that, it should prompt you with a dialog box asking you what type of project you want to make. Choose Standard EXE and press open.

    First Step.

    Once you have done that, you should have something that looks like this:

    Step 2.

    Now we are going to set up the design of the application. To do this we are going to need one Winsock control. Yip, that is all. The Winsock control works with the internet and LAN.

    We need to, to start off our design, insert the WInsock control. We do this because they are not there when we start up Visual Basic 6.0. So go ahead and press CONTROL+T. This will bring up the components window. Scrooooolll down until you find something that says, "Microsoft Winsock Control 6.0" or similar. Select it and press OK.

    Step 5

    You'll see a new item in your toolbox. This is the Winsock control. Select it and put it into your form.

    Step 6

    Time to code :D

    Double click on the form. It should come up with some code like this:

    Private Sub Form_Load()

    End Sub

    In the middle of this, insert this code

    MsgBox Winsock1.LocalIP
    End

    You should now have this code

    Private Sub Form_Load()
    MsgBox Winsock1.LocalIP
    End
    End Sub

    What this is telling the application to do is, when the form is loaded, to display a message box. It tells the message box to say your IP address. It does this with the code "Winsock1.LocaIP."

    The peice of code that says "End" tells the application to end after you press OK on the message box. We put End there because we don't want it to show a blank form when you press OK.

    Now press F5. This will run your application. Alternitivly you can press this button (the one highlighted in blue):

    When you do this, a message box should come up saying something like "***.**.****.**" (Replace the *'s with numbers."

    When you are done with your application, exit out of it and save.

     

    Download Project

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      .NET (8)
      Buttons (3)
      Database Related (7)
      Date and Time (1)
      Development (3)
      Error Handling (2)
      File Manipulation (5)
      Introduction to Visual Basic (19)
      Miscellaneous (3)
      Multimedia (10)
      Networking (10)
      Security (1)
      VB Script (6)

    New

    Hot