suppose i work on asp.net MVC web application and this application hosted on IIS so i need to get computer name of user
visit web application as example client A have computer-001 he visit web application then get computer name computer-001 and display it on application .
computer B
have computer name computer-002 then register computer name computer-002 on web application using asp.net mvc
so exactly i need to get computer name that visit web application
public ActionResult GetAuditLog(ResignationRequester resignationRequester)
{
string computername=get computer visit my web application who run my app
}
Vishal YelvePosted Dec 13, 2023, 7:00 AM
Hi Ahmed,
Two things to consider:
HttpContext.Current.Request.ServerVariables.Item("REMOTE_HOST") will return the name of the host making the request, not the address.System.Net.Dns.GetHostByAddress(Request.ServerVariables.Item("REMOTE_HOST")).HostNameinstead.You can find a list of the Server Variables at Microsoft's MSDN website.
Hope that helps