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


C# KeyCode.GetKeyCode方法代码示例

本文整理汇总了C#中KeyCode.GetKeyCode方法的典型用法代码示例。如果您正苦于以下问题:C# KeyCode.GetKeyCode方法的具体用法?C# KeyCode.GetKeyCode怎么用?C# KeyCode.GetKeyCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KeyCode的用法示例。


在下文中一共展示了KeyCode.GetKeyCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Register

	    public void Register(Person p, PersonAddress pa)
    {
        PasswordHash phash = new PasswordHash();
        KeyCode keycode = new KeyCode();
        int key = keycode.GetKeyCode();
            byte[] hash = phash.HashIt(p.PersonPlainPassword, key.ToString());


        Person person = new Person();
            person.PersonFirstName = p.PersonFirstName;
            person.PersonLastName = p.PersonLastName;
            person.Personpasskey = key;
            person.PersonUsername = p.PersonUsername;
            person.PersonPlainPassword = p.PersonPlainPassword;
            person.PersonUserPassword = hash;
            person.PersonEntryDate = DateTime.Now;
            communityAssistDb.People.Add(person);

            PersonAddress pAddress = new PersonAddress();
            pAddress.Person = person;
            pAddress.Apartment = pa.Apartment;
            pAddress.Street = pa.Street;
            pAddress.City = pa.City;
            pAddress.State = pa.State;
            pAddress.Zip = pa.Zip;
            communityAssistDb.PersonAddresses.Add(pAddress);

            communityAssistDb.SaveChanges();
    }
开发者ID:bschwartz757,项目名称:CSharp-ASP.NET,代码行数:29,代码来源:CADonorRegisterService.cs

示例2: btnRegister_Click

    protected void btnRegister_Click(object sender, EventArgs e)
    {
        try
        {
            ShowTrackerEntities db = new ShowTrackerEntities();
            Fan f = new Fan();
            FanLogin fl = new FanLogin();
            fl.Fan = f;

            f.FanName = txtFirstName.Text + " " + txtLastName.Text;
            f.FanEmail = txtEmail.Text;
            f.FanDateEntered = DateTime.Now;

            fl.FanLoginUserName = txtUserName.Text;
            fl.FanLoginDateAdded = DateTime.Now;
            fl.FanLoginPasswordPlain = txtPassword.Text;

            KeyCode kc = new KeyCode();
            int code = kc.GetKeyCode();

            PasswordHash ph = new PasswordHash();
            Byte[] hashed = ph.HashIt(txtPassword.Text, code.ToString());

            fl.FanLoginRandom = code;
            fl.FanLoginHashed = hashed;

            db.Fans.Add(f);

            fl.Fan = f;
            db.FanLogins.Add(fl);

            db.SaveChanges();
            lblErrorSuccess.Text = "Reviewer Saved";
        }
        catch (Exception ex)
        {
            lblErrorSuccess.Text = ex.Message;
        }
    }
开发者ID:bschwartz757,项目名称:CSharp-ASP.NET,代码行数:39,代码来源:Register.aspx.cs


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