Click here to Skip to main content
15,748,749 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,, VS2010
i would want to get the username of the person logged client pc that accesses the webpage
i have tried
HttpContext.Current.User.Identity.Name.ToString().Remove(0, 7)

but once the webpage is in the live env, it throws an error

please help me on this

[no name] 13-Oct-11 7:41am    
And what is the error?

That won't work unless you are using Membership Providers, and even then it will only give you the user log in to your web system.
You cannot get the client log in identity for his machine - he may not even have one, but security does not allow you to even find that out.
The server cannot access details of the users environment, and his log in id is part of that information.
Share this answer
after some searching, got the way to do this and is working well
had set the authentication to windows in the webconfig and set up IIS to use basic windows authentication.
and it pulls out the username with the

and adding System.Web and System.Web.Security

tried using this after hosting it on the server and works well.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900