本文整理汇总了C#中Credentials.GetPassword方法的典型用法代码示例。如果您正苦于以下问题:C# Credentials.GetPassword方法的具体用法?C# Credentials.GetPassword怎么用?C# Credentials.GetPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Credentials
的用法示例。
在下文中一共展示了Credentials.GetPassword方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_be_possible_be_possible_to_get_all_credential_informations
public void Should_be_possible_be_possible_to_get_all_credential_informations()
{
var credentials = new Credentials("mss", "lfernandes", "123456\\b", "RooT");
AssertCredentials(credentials, "mss", "lfernandes", "RooT");
Assert.AreEqual("123456\\b", credentials.GetPassword(), "An unexpected password value was found.");
}
示例2: Should_return_empty_string_for_null_credentials_parts
public void Should_return_empty_string_for_null_credentials_parts()
{
var credentials = new Credentials(null, null, null, null);
Assert.AreEqual(string.Empty, credentials.GetDomain(), "Domain value must be empty.");
Assert.AreEqual(string.Empty, credentials.GetUserName(), "Username value must be empty.");
Assert.AreEqual(string.Empty, credentials.GetPassword(), "Password value must be empty.");
Assert.AreEqual(string.Empty, credentials.GetAdminPassword(), "Administrative Password value must be empty.");
Assert.AreEqual(string.Empty, credentials.GetFullyQualifiedUsername(), "Fully qualified username value must be empty.");
}
示例3: GetConnectionOptions
private ConnectionOptions GetConnectionOptions(Credentials credentials)
{
ConnectionOptions options = this.createConnectionOptions();
if (this.isThereCredentials(credentials))
{
options.Username = credentials.GetFullyQualifiedUsername();
options.Password = credentials.GetPassword();
}
return options;
}
示例4: GetConnectionOptions
private ConnectionOptions GetConnectionOptions(Credentials credentials)
{
ConnectionOptions options = new ConnectionOptions();
options.Impersonation = ImpersonationLevel.Impersonate;
options.Authentication = AuthenticationLevel.Default;
options.EnablePrivileges = true;
if (this.IsThereCredential(credentials))
{
options.Username = credentials.GetFullyQualifiedUsername();
options.Password = credentials.GetPassword();
}
return options;
}