When it comes to network programming you need to use a few common methods

  • 2020-05-05 11:09:12
  • OfStack

When it comes to network programming, you need to use a few common methods

1. Special attribute in ASP.NET:
Get the name of the server computer: Page.Server.ManchineName
Get user information: Page.User
Access to the client computer name: Page. Request. UserHostName
Access to the client computer IP: Page. Request. UserHostAddress

2. General approach in network programming:
Gets the current computer name: static System. Net. Dns. GetHostName
() According to the computer name withdrawing all IP address: static System. Net. Dns. Resolve (computer) AddressList
Also can according to IP address to take out the computer name: static System. Net. Dns. Resolve (IP address). HostName

3. Common attribute of system environment class:
The current computer name: static System. Environment. MachineName
The current computer domain: static System. Environment. UserDomainName
Current computer users: static System. Environment. UserName


Related articles: