The IP address in ASP.NET, the current user's method attributes large integration

xiaoxiao2021-03-06  100

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

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

New Post(0)