// constructors public AuthIdentity(string username, SecureString password) { Username = null; UsernameLength = 0; if (!string.IsNullOrEmpty(username)) { Username = username; UsernameLength = username.Length; } Password = IntPtr.Zero; PasswordLength = 0; if (password != null && password.Length > 0) { #if NET452 Password = Marshal.SecureStringToGlobalAllocUnicode(password); #else Password = SecureStringMarshal.SecureStringToGlobalAllocUnicode(password); #endif PasswordLength = password.Length; } Domain = null; DomainLength = 0; Flags = AuthIdentityFlag.Unicode; }
// constructors public AuthIdentity(string username, SecureString password) { Username = null; UsernameLength = 0; if (!string.IsNullOrEmpty(username)) { Username = username; UsernameLength = username.Length; } Password = IntPtr.Zero; PasswordLength = 0; if (password != null && password.Length > 0) { #if NET45 Password = Marshal.SecureStringToGlobalAllocUnicode(password); #else Password = SecureStringMarshal.SecureStringToGlobalAllocUnicode(password); #endif PasswordLength = password.Length; } Domain = null; DomainLength = 0; Flags = AuthIdentityFlag.Unicode; }
public AuthIdentity(string username, string password) { Username = null; UsernameLength = 0; if (!string.IsNullOrEmpty(username)) { Username = username; UsernameLength = username.Length; } Password = null; PasswordLength = 0; if (!string.IsNullOrEmpty(password)) { Password = password; PasswordLength = password.Length; } Domain = null; DomainLength = 0; Flags = AuthIdentityFlag.Unicode; }