Contacting HomeSeer This Week

HomeSeer is open and operational this week. All orders are being processed and shipped as usual. However, some staff are working from home. If you need to contact HomeSeer for support or customer service, please use our Email or Chat options.
See more
See less

[ Script] Get your ip

  • Filter
  • Time
  • Show
Clear All
new posts

  • [ Script] Get your ip

    getmyip seems to be not working lately. So, I wrote this simple vb script to get ip & post the htm file to your host page.

    'Code starts here
    Dim getHost As String = ""
    Dim getPage As String = "/htbin/ipaddress"
    Dim getStripTags As Boolean = False
    Dim getPort As Integer = 80

    Dim putHost As String = "your host name" ' something like ""
    Dim putUserName As String = "youruserid"
    Dim putPassword As String = "yourftppassword"
    Dim putCommand As String = "put"
    Dim putPath As String = ""
    Dim putLocalFile As String = "ip.htm"
    Dim putRemoteFile As String = "ip.htm"

    Sub Main(parm as object)
    Dim content As String = hs.GetURL(getHost, getPage, getStripTags, getPort)
    'hs.WriteLog("GETIP", content)

    Dim sr As System.IO.StreamReader = New System.IO.StreamReader(putLocalFile)
    Dim oldContent As String = sr.ReadToEnd()
    'hs.WriteLog("GETIP", "oldContent = " & oldContent)

    Dim sw As System.IO.StreamWriter = System.IO.File.CreateText(putLocalFile)


    If String.Compare(oldContent, content) <> 0
    hs.WriteLog("GETIP", "ftp new ip")
    hs.ftp(putHost, putUserName, putPassword, putCommand, putPath, putLocalFile, putRemoteFile)
    End If
    End Sub
    Last edited by Rupp; August 4th, 2006, 02:12 PM.