Hi...
How can we get a list of users of a company ??
Eg -
Assume that a person is working in IBM.
Now, IBM is everywhere - India, UK, US, etc and world wide.
Hint -All machines (Computers, laptops, etc) of IBM are connected to IBM domain.
Problem - How to get a list of all the users of IBM in asp.net in datatable and display them in a gridview ??
I have 2 things -
1. Domain - IBM.com
2. Global IP Address - 1.1.1.1
-------------
How to get a list of IP Address and Computers Names of all the machines (Computers) connected to a LAN.
--------------------------
How to get list of users of Windows OS ??
Eg -
In a machine where Windows 7 or Windows 8 is installed and I create 6 users in it,
how do I get the details of these 6 users of my machine in a datatable??
Please Help.
Loading
Piyush PansuriyaPosted Jan 19, 2015, 8:03 AM
IP & InitParams are string variables
I gave you my sample code. Its working.
Riddhi ValechaPosted Jan 19, 2015, 4:49 AM
I did not get all the users when I implemented this code.
Can you give me a sample working code ??
I had created 10 users, but I got only 2 users.
Also, "IP" and "InitParams" are String variables ?? OR some other data type ?
Thank you.
Piyush PansuriyaPosted Jan 16, 2015, 2:14 AM
Try This :
IP = ""; InitParams = "";
if (Context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null) //If user is Using Proxy then For its Proxy Detection
IP = "IP=" + Context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
else if (Context.Request.ServerVariables["REMOTE_ADDR"] != null)
IP = "IP=" + Context.Request.ServerVariables["REMOTE_ADDR"];
else
IP = "IP=" + Request.UserHostAddress;
InitParams += "," + IP;
String WindowsUserName;
if(Request.UserHostAddress != "")
InitParams += ",WindowsUserName=" + System.Net.Dns.GetHostEntry(Context.Request.ServerVariables["REMOTE_HOST"]).HostName;
else
InitParams += ",WindowsUserName=" + Request.LogonUserIdentity.Name;