Take a look at the CredentialCache.DefaultCredentials property, if this is
what you are after then you must keep in mind that for a Forms application
you will need to set the PrincipalPolicy of the AppDomain to
WindowsPrincipal
¤
¤
¤ Is there a .Net equivalent for the Win32 API call GetCurrentUserAndDomain?
¤ I need to be able to get the users name at form load time in C# application
You can use System.Security.Principal.WindowsIdentity.GetCurrent.Name to return both:
Dim CurrentUserAndDomain As String() = Nothing
CurrentUserAndDomain = System.Security.Principal.WindowsIdentity.GetCurrent.Name.Split("\"c)
MsgBox(CurrentUserAndDomain(0))
MsgBox(CurrentUserAndDomain(1))
Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)