当前位置: 首页>>代码示例>>C#>>正文


C# SecureString.GetString方法代码示例

本文整理汇总了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;
            }
        }
开发者ID:Simsso,项目名称:Crusades,代码行数:28,代码来源:Server.cs

示例2: AppendStringFact

        public void AppendStringFact()
        {
            const string S = @"朧";
            var secureString = new SecureString();
            secureString.AppendString(S);

            var s = secureString.GetString();

            Assert.Equal(S, s);
        }
开发者ID:kkkkkkaaaaaa,项目名称:kkkkkkaaaaaa,代码行数:10,代码来源:KandaSecureStringFacts.cs

示例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);
            }
        }
开发者ID:xunter,项目名称:PavelNazarov.Common,代码行数:15,代码来源:SecureStringExtensionsTests.cs

示例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;
            }
        }
开发者ID:Simsso,项目名称:Crusades,代码行数:28,代码来源:Server.cs

示例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;
            }
        }
开发者ID:Simsso,项目名称:Crusades,代码行数:27,代码来源:Server.cs


注:本文中的System.Security.SecureString.GetString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。