Results 1 to 3 of 3

Thread: IP problems

  1. #1

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544

    Unhappy

    I'm having problems retrieving my CORRECT IP address!
    I place a WinSock control in my form, and wites the following code:

    Code:
    Private Sub Form_Load()
    	MsgBox Winsock1.LocalIP
    End Sub
    Now it should return my static IP 1.0.0.1, but it returns 246.132.155.221 and my
    computer name is 'cybercarsten', but it returns my username for my Internet Connection!!!
    What is wrong here!!!!????
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  2. #2

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    No need to reply guys! : o )
    I found out that, it was he installer cd from my ISP that made a registry error, and changed my hostname and IP!
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  3. #3
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    i'm sure there is a better way, but what I did way batch the command route print and get all the addresses local to the machine.





    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal opOperation As String, ByVal lpFile As String, ByVal opParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long



    Public Sub ShellExe(What As String)
    On Error Resume Next
    Call ShellExecute(0&, vbNullString, What, vbNullString, vbNullString, vbNormalFocus)
    End Sub







    Private Sub Command1_Click()


    Dim InD As String
    Dim a As Integer
    Dim b As Integer

    Dim m1
    Dim m2


    Open "c:\temp.bat" For Output As 1
    Print #1, "route print > c:\temp.txt"
    Close #1

    Shell "c:\temp.bat", vbMinimizedFocus

    t = Timer
    Do Until Val(t) + 1 < Timer
    Loop

    Open "c:\temp.txt" For Input As #1
    InD = Input(LOF(1), 1)
    Close #1


    m1 = Split(InD, vbCrLf)

    b = 1
    Do Until InStr(m1(b), "Metric") <> 0 Or b > 15
    b = b + 1
    Loop
    b = b + 1

    For a = b To UBound(m1)
    If InStr(m1(a), "=====") Then
    a = UBound(m1)
    Else
    Debug.Print Trim(Mid(m1(a), 53, 16))
    End If
    Next a


    End Sub


    Kurt Simons
    [I know I'm a hack but my clients don't!]

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