_TYPE_SERVER_NT = 0x00008000, _TYPE_POTENTIAL_BROWSER = 0x00010000, _TYPE_BACKUP_BROWSER = 0x00020000, _TYPE_MASTER_BROWSER = 0x00040000, _TYPE_DOMAIN_MASTER = 0x00080000, _TYPE_SERVER_OSF = 0x00100000, _TYPE_SERVER_VMS = 0x00200000 , _TYPE_WINDOWS = 0x00400000, _TYPE_DFS = 0x00800000, _TYPE_CLUSTER_NT = 0x01000000, _TYPE_TERMINALSERVER = 0x02000000, _TYPE_CLUSTER_VS_NT = 0x04000000, _TYPE_DCE = 0x10000000, _TYPE_ALTERNATE_XPORT = 0x20000000, _TYPE_LOCAL_LIST_ONLY = 0x40000000, _TYPE_DOMAIN_ENUM = 0x80000000, _TYPE_ALL = 0xFFFFFFFF,
}
[StructLayout (LayoutKind.Sequential)] struct SERVER_INFO_101
{
[MarshalAs (UnmanagedType.U4)] uint sv101_platform_id;
[MarshalAs (UnmanagedType.LPWStr)] string sv101_name;
[MarshalAs (UnmanagedType.U4)] uint sv101_version_major;
[MarshalAs (UnmanagedType.U4)] uint sv101_version_minor;
[MarshalAs (UnmanagedType.U4)] uint sv101_type;
[MarshalAs (UnmanagedType.LPWStr)] string sv101_comment;
} enum PLATFORM_ID: uint
{_ID_DOS = 300, _ID_OS2 = 400, _ID_NT = 500, _ID_OSF = 600, _ID_VMS = 700,
} enum NERR
{_Success = 0, _ACCESS_DENIED = 5, _NOT_ENOUGH_MEMORY = 8, _BAD_NETPATH ​​= 53, _NETWORK_BUSY = 54, _INVALID_PARAMETER = 87, _INVALID_LEVEL = 124, _MORE_DATA = 234, _EXTENDED_ERROR = 1208, _NO_NETWORK = 1222, _INVALID_HANDLE_STATE = 1609, _NO_BROWSER_SERVERS_FOUND = 6118,
} ArrayList GetServerList (SV_101_TYPES type)
{_INFO_101 si; pInfo = IntPtr.Zero; etriesread = 0; totalentries = 0; srvs = new ArrayList ();
{err = NetServerEnum (null, 101, out pInfo, -1, ref etriesread, ref totalentries, type, null, 0); ((err == NERR.NERR_Success | | err == NERR . ERROR_MORE_DATA) && pInfo! = IntPtr.Zero)
{ptr = pInfo.ToInt32 (); (int i = 0; i
{= (SERVER_INFO_101) Marshal.PtrToStructure (new IntPtr (ptr), typeof (SERVER_INFO_101));. Add (si.sv101_name); + = Marshal.SizeOf (si);
}
}
} (Exception)
{
}
{(pInfo! = IntPtr.Zero)
{(pInfo);
}
} (srvs);
}
} void ShowIPAddresses (IPInterfaceProperties adapterProperties)
{dnsServers = adapterProperties.DnsAddresses; (dnsServers! = null)
{(IPAddress dns in dnsServers)
{. AppendText ("DNS Servers:" + dns.ToString () + " r n");
}
} gateway = adapterPr...