Public Class Form1
Dim oldresult
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
My.Computer.Network.DownloadFile("http://checkip.dyndns.org/", "C:\ip.txt", "", "", False, 100000, True)
TextBox1.Text = My.Computer.FileSystem.ReadAllText("C:\ip.txt")
Dim teststring = TextBox1.Text
Dim result
result = teststring.Substring(teststring.IndexOf(":") + 2)
teststring = Mid(result, 1, Len(result) - 16)
result = teststring
TextBox1.Text = result
If result <> oldresult Then
If My.Computer.FileSystem.DirectoryExists("C:\wwwroot\") = True Then
My.Computer.FileSystem.WriteAllText("C:\WWWRoot\ip.zuz", result, True)
Else
My.Computer.FileSystem.CreateDirectory("C:\wwwroot\")
My.Computer.FileSystem.WriteAllText("C:\WWWRoot\ip.zuz", result, True)
End If
Me.Text = result
oldresult = result
End If
End Sub
End Class
this is the code for a program to update the ip of the server (if dynamic) into the file called ip.zuz which will be held on the web server of the game server computer, the launcher i coded will download this file and extract the ip from the ip.zuz file and update the ip to be used for connecting to the server in the registry and ptreg.rgx file.

