Get a computer name in .NET, IP address and current username are very simple. The following is a few ways I have commonly used. If you have other good methods, you can reply together:
1. Private attributes in ASP.NET: Get server name: page.server.manchinename Get User Information: Page.Request.userHostname Get Client Computer IP: Page.Request.userHostaddress
2. General Method in Network Program: Get the current computer name: static system.net.dns.getHostName () Remove all IP addresses according to the computer name: static system.net.dns.resolve (computer name) .Addresslist can also be based IP address removing the computer name: static system.net.dns.resolve (IP address) .hostname
3. General Properties of System Environment: Current computer name: static system.environment.Machinename current computer belongs: static system.environment.Userdomainname Current computer users: static system.environment.username
Posted on September 03, 2004 8:35 PM