How to retrieve user name in case of Window Authentication?



How to retrieve user name in case of Window Authentication?..

Answer / Shyam Sunder Trivedi

"In .NET, you can retrieve the username for Windows Authentication using the built-in WindowsIdentity class. Here's an example: string username = WindowsIdentity.GetCurrent().Name; This code retrieves the current user's username."n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

Is it possible to write code in many languages in one asp.net project?

1 Answers  


What is the typical session identifier?

1 Answers  


Various types of Page Load functions

4 Answers   Net Solution,


In order to get assembly info which namespace we should import?

1 Answers  


Why select Web API?

1 Answers  


if you disable view state of a textbox will it maintain data during postbacks.if yes reason

9 Answers   FactorH, Jindal, Oxi Infotech,


What is the difference between GridView and Repeater controls in ASP.NET?

1 Answers  


To display data in the combo box, prior to setting the Data Source, what kind of property on a Combo Box do you set with a column name?

1 Answers   Siebel,


What are html helpers in asp.net?

1 Answers  


What is the concepts of globalization and localization in .net?

1 Answers  


How much is the pay-for-use service if I chose not to use microsoft-sponsored advertising?

1 Answers  


Explain why it is useful to use mvc instead of webforms? : asp.net mvc

1 Answers  


Categories