There's probably something in the iphelper API for this (I haven't dug deep enought to check). See:

http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

Or check out an example here that shows a lot of what IPHelper API can do:

http://www.codeproject.com/KB/IP/IPHelper.aspx