In. net, it is very easy to get a computer name, IP address and current user name. The following are some of my frequently used methods. If you have other good methods, you can reply to them:
1. Special attributes in ASP. NET:
Get server computer name: page. server. manchinename
Get user information: page. User
Obtain the client computer name: page. Request. userhostname
Obtain the Client IP Address: page. Request. userhostaddress
2. General methods in network programming:
Obtain the current computer name:StaticSystem. net. DNS. gethostname ()
Retrieve all IP addresses based on the computer name:StaticSystem. net. DNS. Resolve (computer name). Addresslist
You can also retrieve the computer name based on the IP Address:StaticSystem. net. DNS. Resolve (IP address). hostname
3. General attributes of the system environment:
Current computer name:StaticSystem. environment. machinename
Domain Name of the current computer:StaticSystem. environment. userdomainname
Current computer user:StaticSystem. environment. Username
........................................ ........................................ ......................
More highlights:. net