---
title: "How get Account name of computer using ip address"  
description: "How get Account name of computer using ip address"  
author: "Anonymous User"  
published: 2014-10-06  
updated: 2014-10-06  
canonical: https://www.mindstick.com/forum/2311/how-get-account-name-of-computer-using-ip-address  
category: "c#"  
tags: ["c#", "asp.net"]  
reading_time: 1 minute  

---

# How get Account name of computer using ip address

I need to track which [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) [account](https://www.mindstick.com/articles/33699/how-tech-is-disrupting-the-accounting-world) on the same pc is using my [software](https://www.mindstick.com/articles/311636/best-freelancing-websites-to-get-software-development-services) which is an [web application](https://www.mindstick.com/articles/13069/progressive-web-application-pwas-all-you-need-to-know-about). Is this possible? I can only get computer [name](https://yourviews.mindstick.com/view/87450/how-to-generate-a-brand-name-using-linkedin-comprehensive-guide) but not user account name. I need to find out whether it is administrator or guest.

## Replies

### Reply by Anonymous User

try this code:

```
    public static string GetIP4Address()        {            string IP4Address = String.Empty;             foreach (IPAddress IPA in Dns.GetHostAddresses(HttpContext.Current.Request.UserHostAddress))            {                if (IPA.AddressFamily.ToString() == "InterNetwork")                {                    IP4Address =
IPA.ToString();                    break;                }            }             if (IP4Address != String.Empty)            {                return IP4Address;            }             foreach (IPAddress IPA in Dns.GetHostAddresses(Dns.GetHostName()))            {                if (IPA.AddressFamily.ToString() == "InterNetwork")                {                    IP4Address = IPA.ToString();                    break;                }            }             return IP4Address;        }
```


---

Original Source: https://www.mindstick.com/forum/2311/how-get-account-name-of-computer-using-ip-address

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
