Get a computer name, IP address, and current username in .NET.

xiaoxiao2021-03-06  55

1. Special properties in ASP.NET:

Get server computer name: Page.Server.manchinename

Get User Information: Page.user

Get the client computer name: page.Request.Userhostname

Get Client Computer IP: Page.Request.userHostAddress

2. General methods in network programming:

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

You can also remove the computer name according to the IP address: static system.net.dns.resolve (IP address) .hostname

3. General attributes of the system environment:

Current computer name: static system.environment.machinename

Current computer belongs: static system.environment.userdomainname

Current computer user: static system.environment.username

转载请注明原文地址:https://www.9cbs.com/read-113255.html

New Post(0)