本文整理汇总了C#中User.setPassword方法的典型用法代码示例。如果您正苦于以下问题:C# User.setPassword方法的具体用法?C# User.setPassword怎么用?C# User.setPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User
的用法示例。
在下文中一共展示了User.setPassword方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: New
public ActionResult New(UsersNew form)
{
if (Database.Session.Query<User>().Any(u => u.Username == form.Username))
ModelState.AddModelError("UserName", "Username must be unique");
if (!ModelState.IsValid)
return View(form);
var user = new User
{
Email = form.Email,
Username = form.Username
};
user.setPassword(form.Password);
Database.Session.Save(user);
return RedirectToAction("index");
}
示例2: checkRegister
public void checkRegister()
{
//InputField[] input;
//input = GameObject.Find("/Login/RegisterPanel/Input").GetComponentsInChildren<InputField>();
foreach (InputField cin in inputField)
{
if (cin.text == "")
{
Debug.Log(cin.name);
finish = false;
switch (cin.name)
{
case "emailText":
hintText.text = "信箱錯誤";
break;
case "nicknameText":
hintText.text = "匿稱錯誤";
break;
case "nameText":
hintText.text = "姓名錯誤";
break;
case "accountText":
hintText.text = "帳號錯誤";
break;
case "password_againText":
hintText.text = "密碼錯誤";
break;
case "passwordText":
hintText.text = "密碼錯誤";
break;
default:
hintText.text = "Fuck";
break;
}
break;
}
finish = true;
}
if (finish)
{
if (connect.isConnect())
{
//do thing
newAccount = new User();
foreach (InputField cin in inputField)
{
switch (cin.name)
{
case "emailText":
newAccount.setEmail(cin.text);
break;
case "nicknameText":
newAccount.setNickname(cin.text);
break;
case "nameText":
newAccount.setName(cin.text);
break;
case "accountText":
newAccount.setAccount(cin.text);
break;
case "password_againText":
newAccount.setPassword(cin.text);
break;
}
}
//Dropdown d_gender= GameObject.Find("/Login/RegisterPanel/Input/gender").GetComponent<Dropdown>();
if (gender.value == 0) newAccount.setGender("M");
else if (gender.value == 1) newAccount.setGender("F");
StartCoroutine(doRegister());
}
else
{
hintText.text = "請檢查網路連線狀況";
Debug.Log("disconnect!");
}
}
else
{
hintText.text += "請重新檢查";
}
}