Hi,
I want to give a domain name(DNS) to my application which have public ip address. How can i give this in asp.net 3.5 using c#.
plz help me..
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Soft CornerPosted Feb 10, 2011, 3:47 AM
1) System.Security.Principal.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;string strName = p.Identity.Name;
[ OR ]2)string strName = HttpContext.Current.User.Identity.Name.ToString();[ OR ]
3) string strName = Request.ServerVariables["AUTH_USER"]; //Finding with namestring strName = Request.ServerVariables[5]; //Finding with indexIn Above 3 Cases returnin string contains DomainName\WinNTLoggedUserName
(for Ex: Microsoft\Bill.Gates. Here Microsoft is domain Bill.Gates is Logger User Name )
Using string operations seperate the DomainName and UserName