public String GetIPAddress() { if (_connection == IntPtr.Zero) { throw new RasException("The connection is not established."); } var pppip = new RASPPPIP(); var size = (UInt32)Marshal.SizeOf(typeof(RASPPPIP)); pppip.dwSize = size; UInt32 result = RasNativeMethods.RasGetProjectionInfo(_connection, RASPROJECTION.RASP_PppIp, pppip, ref size); if (result != 0) { throw new RasException(result); } return(pppip.szIpAddress); }
public static extern UInt32 RasGetProjectionInfo(IntPtr hRasConn, RASPROJECTION projection, [In, Out] RASPPPIP pppip, ref uint ppipSize);