I think this code is for Windows application. If we use it in a webform it always returnmy Discountasp.net server machine ID: WEB110\aspnet_1280.. What I wish to know is the machine ID the user uses to connect to my web sites. Thanks.
I do not think it is possible. Webform application (on the server) do not have access to security information on the client machine. Bruce DiscountASP.NET www.DiscountASP.NET
Thank you for your kind responses. You might be right. I'm now turning to VBScripts for a solution. Do you have any suggestions on this subject?
try reading through the WindowsIdentity class: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemsecurityprincipalwindowsidentityclasstopic.asp
Now Ihave managed toobtain the information I need through a VBScript but I don't know how to migrate it to server side code. Could you please help me out? Thanks.
System.Security.Principal.WindowsImpersonationContext userID; this.userID = ((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate(); try that one Will
After adding references to Windows.Form and System.Security I plugged your code into a test web application as follows: protected System.Security.Principal.WindowsImpersonationContext userID; private void Page_Load(object sender, System.EventArgs e){ this.userID = ((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate(); } ERROR: An anonymous identity cannot perform an impersonation. Thank you for your kind response.
you need to change the settings for the project in IIS you are not using Windows Authentication run Microsoft Management Console (MMC) Add the IIS Add-In Right click on your website project folder Goto Directory Security Hit the Edit Button Make sure that Integrated Windows Authentication is checked. I believe this will only work for computers logged into your domain using their Windows Password (Intranet) not Internet users I could be wrong =) other then that I am not sure. Will Post Edited (womalley) : 6/1/2005 9:15:11 PM GMT