Here is some work I did on this a while back. You'll notice that one of the items returned is the client's IP address.

Note the caveat though - this uses Citrix (MetaFrame) SDK.

To be honest I'd forgotten all about it and only turned it up in a search. Remember, "search" is your friend.