That's going to depend on what you think of as the "PC IP Address": it has two and both of those are a problem for you.
The first is the LAN / WLAN address: the address that computers on your side of the router use to talk to each other / the router. Normally, that's of the form
192.168.xxx.yyy
and that's a problem because unless specific actions are taken (which differ depending on the local DHCP controller - normally the router) to assign a static IP address to a device then it gets a new IP address every time it is restarted and that means what address it gets depends on the order in which machines are turned on, and how many of them active there are.
It's also trivial to "spoof" an IP address using a VM, so starting your app in a VM means it doesn't "know" if an IP address is "real" or not.
But, getting that IP address is pretty simple:
IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());
foreach (IPAddress ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
... this is the ip address you want ...
}
}
Do also remember that a machine can have multiple IP LAN / WLAN addresses if it has multiple adaptors: one for CAT 5 wired and one for WiFi for example.
The other IP address is the internet IP address and that's a major problem. Not only is it only obtainable by querying an internet site (Google will find you many ways to do that using different sites which may or may not be "up" any more:
get internet IP address c# - Google Search[
^]) but ... it's not unique. It's actually the IP address of the router, and it's shared between all the devices connected to that router, as well as being allocated by your ISP when your router boots up. And that too is usually dynamic unless special action is taken (which normally involves paying extra) to use a static IP address.
So ... I think you need to rethink this idea - it's unlikely that the IP address will give you anything useful in the real world, and certainly should never be used as a security measure if that's what you were planning!