本文整理汇总了C#中Credential.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Credential.Save方法的具体用法?C# Credential.Save怎么用?C# Credential.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Credential
的用法示例。
在下文中一共展示了Credential.Save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Credential_Load
public void Credential_Load()
{
Credential setup = new Credential("username", "password", "target", CredentialType.Generic);
setup.Save();
Credential credential = new Credential {Target = "target", Type = CredentialType.Generic };
credential.Load().ShouldBeTrue();
credential.Username.ShouldNotBeEmpty();
credential.Password.ShouldNotBeNull();
credential.Username.ShouldEqual("username");
credential.Password.ShouldEqual("password");
credential.Target.ShouldEqual("target");
}
示例2: CredentialSet_Load_With_TargetFilter
public void CredentialSet_Load_With_TargetFilter()
{
Credential credential = new Credential
{
Username = "filteruser",
Password = "filterpassword",
Target = "filtertarget"
};
credential.Save();
CredentialSet set = new CredentialSet("filtertarget");
set.Load().ShouldHaveCountOf(1);
set.Dispose();
}
示例3: CredentialSet_Load
public void CredentialSet_Load()
{
Credential credential = new Credential
{
Username = "username",
Password = "password",
Target = "target",
Type = CredentialType.Generic
};
credential.Save();
CredentialSet set = new CredentialSet();
set.Load();
set.ShouldNotBeNull();
set.ShouldNotBeEmpty();
credential.Delete();
set.Dispose();
}
示例4: Credential_Save
public void Credential_Save()
{
Credential saved = new Credential("username", "password", "target", CredentialType.Generic);
saved.PersistanceType = PersistanceType.LocalComputer;
saved.Save().ShouldBeTrue();
}