The answer to this is complicated by the fact that there can be more than one IP address per machine. I'd check out this StackOverflow thread with more of an explanation. One solution that seems to work particularly well is this one, which you can implement in the below code stage.Inputs: NoneOutputs: Local IP
Using Sock As New Socket(AddressFamily.InterNetwork, SocketType.Dgram, 0)
' Because we are using UDP (SocketType.Dgram), Connect() will not actually connect to anything,
' but it will calculate the route to use which should give us the IP that we're looking for.
Sock.Connect("8.8.8.8", 65530)
Dim EndPoint As IPEndPoint = Sock.LocalEndPoint
Local_IP = EndPoint.Address.ToString()
End Using
You'll need to edit the Code Options and add System.Net and System.Net.Sockets to the Namespace Imports section.
This seemed to work well for me, but you'll want to double check that the IP address it is calculating is the one you're looking for. If not, you'd need additional code to search through the various addresses assigned to your machine.
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------