本文整理汇总了C#中System.Security.SecureString.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# SecureString.GetString方法的具体用法?C# SecureString.GetString怎么用?C# SecureString.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.SecureString
的用法示例。
在下文中一共展示了SecureString.GetString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddUser
public static bool? AddUser(string UserName, string EmailAddress, SecureString Password)
{
try
{
Network.HttpResponse Response = Network.HttpRequest(
ServerUrl,
new Network.GetParameter[] {
new Network.GetParameter("action", "add-user"),
new Network.GetParameter("user-name", UserName),
new Network.GetParameter("email-address", EmailAddress),
new Network.GetParameter("password", Password.GetString())});
if(Response.Status == "OK")
{
if (Response.Value == "1")
return true;
return false;
}
else
{
return null;
}
}
catch (Exception)
{
return null;
}
}
示例2: AppendStringFact
public void AppendStringFact()
{
const string S = @"朧";
var secureString = new SecureString();
secureString.AppendString(S);
var s = secureString.GetString();
Assert.Equal(S, s);
}
示例3: Test_SecureStringExtensions_GetString
public void Test_SecureStringExtensions_GetString()
{
using (var secureString = new SecureString())
{
string pwd = "123456";
foreach (char chr in pwd)
{
secureString.AppendChar(chr);
}
secureString.MakeReadOnly();
string readPwd = secureString.GetString();
Assert.AreEqual(pwd, readPwd);
}
}
示例4: JoinMatch
public static bool? JoinMatch(string UserName, SecureString Password, int MatchId)
{
try
{
Network.HttpResponse Response = Network.HttpRequest(
ServerUrl,
new Network.GetParameter[] {
new Network.GetParameter("action", "join-match"),
new Network.GetParameter("user-name", UserName),
new Network.GetParameter("password", Password.GetString()),
new Network.GetParameter("match-id", MatchId.ToString())});
if (Response.Status == "OK")
{
if (Response.Value == "1")
return true;
return false;
}
else
{
return null;
}
}
catch (Exception)
{
return null;
}
}
示例5: CheckUserNamePasswordCombination
public static bool? CheckUserNamePasswordCombination(string UserName, SecureString Password)
{
try
{
Network.HttpResponse Response = Network.HttpRequest(
ServerUrl,
new Network.GetParameter[] {
new Network.GetParameter("action", "check-username-password-combination"),
new Network.GetParameter("user-name", UserName),
new Network.GetParameter("password", Password.GetString())});
if (Response.Status == "OK")
{
if (Response.Value == "1")
return true;
return false;
}
else
{
return null;
}
}
catch (Exception)
{
return null;
}
}