need2progm
Programmer
I am trying to get the current log in user (DomainName/UserName).. for window authentication for my asp application.
This is what I have so far.. Got this right off MSDN
'Get the current identity and put it into an identity object.
Dim MyIdentity2 As WindowsIdentity = WindowsIdentity.GetCurrent
'Put the previous identity into a principal object.
Dim MyPrincipal2 As New WindowsPrincipal(MyIdentity2)
'Principal values.
Dim PrincipalName2 As String = MyPrincipal2.Identity.Name
This is returning COMPUTERNAME/ASPNET????
How to I get DomainName\USER???
Thanks in advance
This is what I have so far.. Got this right off MSDN
'Get the current identity and put it into an identity object.
Dim MyIdentity2 As WindowsIdentity = WindowsIdentity.GetCurrent
'Put the previous identity into a principal object.
Dim MyPrincipal2 As New WindowsPrincipal(MyIdentity2)
'Principal values.
Dim PrincipalName2 As String = MyPrincipal2.Identity.Name
This is returning COMPUTERNAME/ASPNET????
How to I get DomainName\USER???
Thanks in advance