本文整理汇总了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();
}
示例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;
}
}