- Joined
- Apr 23, 2011
- Posts
- 3,200
- Reaction score
- 793
- Points
- 113
- Age
- 53
Looked useful to me
not sure if it changes your real ip or not

Code:
Imports System
Imports System.Net
Imports System.Net.NetworkInformation
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Shell("netsh interface ip set address name= " & Chr(34) & lstOutput.Text & Chr(34) & " dhcp")
Shell("netsh interface ip set dns name=" & Chr(34) & lstOutput.Text & Chr(34) & " dhcp")
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i As Integer
Dim ni As System.Net.NetworkInformation.NetworkInterface() = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
For Each Items As System.Net.NetworkInformation.NetworkInterface In ni
Me.lstOutput.Items.Add(Items.Name)
If i = 0 Then
lstOutput.Text = Items.Name
End If
i = i + 1
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Shell("netsh interface ip set address name= " & Chr(34) & lstOutput.Text & Chr(34) & " static " & txtip.Text & " " & txtsub.Text & " " & txtgate.Text)
Shell("netsh interface ip set dns name=" & Chr(34) & lstOutput.Text & Chr(34) & " static " & txtdns.Text)
End Sub
End Class