When it comes to network programming, there are several common methods that need to be used.
1. Special properties in ASP.NET:
Get the server computer name: Page.Server.ManchineName
Get user information: Page.User
Get the client computer name: Page.Request.UserHostName
Get the client computer IP: Page.Request.UserHostAddress
2. Common methods in network programming:
Get the current computer name: static System.Net.Dns.GetHostName()
Retrieve all IP addresses based on the computer name: static System.Net.Dns.Resolve(computer name).AddressList
You can also retrieve the computer name based on the IP address: static System.Net.Dns.Resolve(IP address).HostName
3. Common attributes of the system environment class:
Current computer name: static System.Environment.MachineName
The domain the current computer belongs to: static System.Environment.UserDomainName
Current computer user: static System.Environment.UserName