You can try to use something like 'route print'. And get the result of the command. There is your IP Address there.
C:\Documents and Settings\Administrator>route print
======================================================================
+=====
Interface List
0x1 ........................... MS TCP Loopback interface
0x10003 ...00 10 a4 11 4d 60 ...... Intel(R) PRO/100+ MiniPCI
======================================================================
+=====
======================================================================
+=====
Active Routes:
Network Destination Netmask Gateway Interface M
+etric
0.0.0.0 0.0.0.0 192.168.55.1 192.168.55.13
+ 30
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1
+ 1
192.168.55.0 255.255.255.0 192.168.55.13 192.168.55.13
+ 30
192.168.55.13 255.255.255.255 127.0.0.1 127.0.0.1
+ 30
192.168.55.255 255.255.255.255 192.168.55.13 192.168.55.13
+ 30
224.0.0.0 240.0.0.0 192.168.55.13 192.168.55.13
+ 30
255.255.255.255 255.255.255.255 192.168.55.13 192.168.55.13
+ 1
Default Gateway: 192.168.55.1
======================================================================
+=====
Persistent Routes:
None
C:\Documents and Settings\Administrator>
192.168.55.13 is my IP Address
where the netmask is 255.255.255.255 and the gateway is 127.0.0.1.... try to parse the output of this command