Asp. NET get the client ip/user name and other information

Source: Internet
Author: User
Tags to domain

1. Private properties in asp:
Get Server computer name: Page.Server.ManchineName
Get user information: Page.User
Get client computer name: Page.Request.UserHostName
Get client PC IP:Page.Request.UserHostAddress

2. Common methods in Network programming:
Get current computer name: Static System.net.Dns.GetHostName ()
Remove all IP addresses by computer name: Static System.Net.Dns.Resolve (computer name). AddressList
You can also remove the computer name by IP address: static System.Net.Dns.Resolve (IP address). HostName

3. Common properties of the system environment class:
Current computer name: Static System.Environment.MachineName
Current computer belongs to domain: static System.Environment.UserDomainName
Current PC User: Static System.Environment.UserName

Asp. NET get the client ip/user name and other information

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.