本文整理汇总了C#中Parse.ParseUser.SignUpAsync方法的典型用法代码示例。如果您正苦于以下问题:C# ParseUser.SignUpAsync方法的具体用法?C# ParseUser.SignUpAsync怎么用?C# ParseUser.SignUpAsync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parse.ParseUser
的用法示例。
在下文中一共展示了ParseUser.SignUpAsync方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SignUp
public async Task<IHttpActionResult> SignUp([FromBody]Usuario user)
{
try
{
ParseUser usuario = new ParseUser()
{
Username = user.usuario,
Password = user.psw,
Email = user.correo
};
usuario["nombre"] = user.nombre;
Byte[] bytes = Convert.FromBase64String(user.foto);
ParseFile foto = new ParseFile("foto.png", bytes);
await foto.SaveAsync();
usuario["foto"] = foto;
usuario["sexo"] = user.sexo;
usuario["tipo"] = user.tipo;
await usuario.SignUpAsync();
Usuario resp = new Usuario();
resp.usuario = user.usuario;
resp.psw = user.psw;
resp.correo = usuario.Get<string>("email");
resp.foto = usuario.Get<ParseFile>("foto").Url.AbsoluteUri;
resp.sexo = usuario.Get<string>("sexo");
resp.tipo = usuario.Get<string>("tipo");
resp.nombre = usuario.Get<string>("nombre");
resp.ObjectId = usuario.ObjectId;
return Ok(resp);
}
catch (ParseException e) {
return InternalServerError(e);
}
}
示例2: signup
public async void signup(string email, string password, Action signupSuccess, Action signupError) {
var user = new ParseUser ()
{
Username = email,
Email = email,
Password = password
};
try
{
await user.SignUpAsync();
Console.WriteLine("signup done");
if (ParseUser.CurrentUser != null)
{
Console.WriteLine("Connected as : {0}", ParseUser.CurrentUser.Get<string>("username"));
signupSuccess();
}
else
{
throw new Exception ("Parse Current User null");
}
}
catch (Exception e)
{
Console.WriteLine("Signup did not work : "+e.Message);
signupError();
}
}
示例3: SignUp
private void SignUp(string username, string password, string email, Dictionary<string, string> signUpParams)
{
var user = new ParseUser()
{
Username = username,
Password = password,
Email = email
};
foreach(var kvp in signUpParams) {
user[kvp.Key] = kvp.Value;
}
user.SignUpAsync();
/* Task signUpTask = user.SignUpAsync();
signUpTask.ContinueWith(
task => {
Debug.Log("Calling cloud function");
ParseCloud.CallFunctionAsync<Dictionary<string,object>>("GetSuggestions", new Dictionary<string, object>()).ContinueWith(
t => {
var suggestions = t.Result;
if(suggestions != null) {
foreach(var kvp in suggestions) {
Debug.Log(kvp.Key + " " + kvp.Value);
}
}
});
});*/
}
示例4: CreateUser
void CreateUser()
{
ParseUser.LogOut();
var user = new ParseUser(){
Username = usuario,
Password = pwd,
Email = email
};
// other fields can be set just like with ParseObject
user["pontuacao"] = (int) scoreInicial;
user.SignUpAsync().ContinueWith( t => {
if (t.IsFaulted || t.IsCanceled)
{
foreach (var e in t.Exception.InnerExceptions)
{
ParseException parseException = (ParseException)e;
Debug.Log("Error message " + parseException.Message);
Debug.Log("Error code: " + parseException.Code);
}
}
else
{
//SignUpAsync(); //DONE
Debug.Log("Usuário criado com sucesso");
}
});
ParseUser.LogOut();
}
示例5: AddUser
public virtual void AddUser(ParseDatastoreMaster pdm ){
pdm.Dismiss ();
var user = new ParseUser()
{
Username = username.text,
Password = password.text,
Email = email.text
};
user.SignUpAsync().ContinueWith (t =>
{
if (t.IsFaulted || t.IsCanceled)
{
// The login failed. Check the error to see why.
print ("signup failed!");
print (t.Exception.Message);
pdm.updateLoginStateFlag = true;
}
else
{
// Login was successful.
print ("signup success");
pdm.updateLoginStateFlag = true;
}
});
}
示例6: RegUser
//Sample Parse Function
public async Task RegUser (string un, string ps, string em)
{
ParseUser user = new ParseUser ();
user.Username = un;
user.Password = ps;
user.Email = em;
// other fields can be set just like with ParseObject
//user ["phone"] = "415-392-0202";
try
{
await user.SignUpAsync ();
Console.WriteLine ("Account Creation Success");
// Login was successful.
//TODO: Open up a new page
//await Navigation.PushModalAsync (new NEWPAGENAME () );
}
catch (Exception e)
{
// The login failed. Check the error to see why.
Console.WriteLine("Signup error: " + e.Message);
DisplayAlert ("Error", e.Message, "OK", "Cancel");
}
}
示例7: createNewUser
public static void createNewUser(string username, string password, System.Action<bool> complete)
{
ParseUser user = new ParseUser (){
Username = username,
Password = password,
Email = username + "@fakeEmailabc123.com"
};
user.SignUpAsync().ContinueWith(t => {
if (t.IsFaulted) {
// Errors from Parse Cloud and network interactions
using (IEnumerator<System.Exception> enumerator = t.Exception.InnerExceptions.GetEnumerator()) {
if (enumerator.MoveNext()) {
ParseException error = (ParseException) enumerator.Current;
// error.Message will contain an error message
// error.Code will return "OtherCause"
Debug.Log(error.Code + " : " + error.Message);
complete(false);
}
}
}
else {
complete(true);
}
});
}
示例8: Registration
void Registration()
{
Debug.LogError("Registration has been called");
if (usernameRegister.text == "Your full name" || emailRegister.text == "Your email" || repassRegister.text == "Enter password again" || usernameRegister.text == "" || emailRegister.text == "" || passwordRegister.text == "" || repassRegister.text == "")
{
message = "Please enter all the fields";
Debug.LogError ("" +message);
}
else
{
if (passwordRegister.text == repassRegister.text)
{
Debug.LogError("Passwords Matched");
var userCurrent = new ParseUser(){
Username = usernameRegister.text,
Email = emailRegister.text,
Password = passwordRegister.text
};
// Debug.LogError ("" +userCurrent);
Task signUpTask = userCurrent.SignUpAsync();
message = "Sign up successful. Check your email for verification!";
}
else
{
message = "Your Password does not match";
}
}
}
示例9: CreateUser
public async Task<User> CreateUser(string username, string pass, string email)
{
try
{
var user = new ParseUser()
{
Username = username,
Password = pass,
Email = email
};
User createdUser = new User()
{
Username = user.Username
};
await user.SignUpAsync();
await ParseUser.LogInAsync(username, pass);
((App)App.Current).AuthenticatedUser = ParseUser.CurrentUser;
return createdUser;
}
catch (Exception e)
{
new MessageDialog(e.Message).ShowAsync();
return null;
}
}
示例10: SignUp
private void SignUp()
{
ParseUser userToSignUp = new ParseUser() {
Username = CurrentUser.Username,
Password = CurrentUser.Password
};
userToSignUp.SignUpAsync();
}
示例11: btnCreateAccount_TouchUpInside
/// <summary>
/// Buttons the create account touch up inside.
/// </summary>
/// <param name="sender">Sender.</param>
async partial void btnCreateAccount_TouchUpInside (UIButton sender)
{
var firstName = txtFirstName.Text;
var lastName = txtLastName.Text;
var username = txtUser.Text;
var password = txtPassword.Text;
var confirmPassword = txtConfirm.Text;
var alert = new UIAlertView();
if ((string.IsNullOrEmpty(username)) || (string.IsNullOrEmpty(password)) ||
(string.IsNullOrEmpty(firstName)) ||
(string.IsNullOrEmpty(lastName)))
{
alert = new UIAlertView("Input Validation Failed", "Please complete all the input fields!", null, "OK");
alert.Show();
}
else
{
if (password != confirmPassword)
{
alert = new UIAlertView("Input Validation Failed", "Password and Confirm Password must match!", null, "OK");
alert.Show();
}
else
{
try
{
var user = new ParseUser()
{
Username = username,
Password = password,
} ;
user["LastName"] = lastName;
user["FirstName"] = firstName;
await user.SignUpAsync();
alert = new UIAlertView("Account Created", "Your account has been successfully created!", null, "OK");
alert.Show();
NavigationController.PopViewController (true);
}
catch(Exception ex)
{
var error = ex.Message;
alert = new UIAlertView("Registration Failed", "Sorry, we might be experiencing some connectivity difficulties or your email is already in the system!", null, "OK");
alert.Show();
}
}
}
}
示例12: OnEnter
public override void OnEnter()
{
ParseUser user = new ParseUser()
{
Username = username.IsNone ? email.Value : username.Value,
Password = password.Value,
Email = email.Value
};
_task = user.SignUpAsync();
}
示例13: goToRegistrarusuario
private async void goToRegistrarusuario(object sender, RoutedEventArgs e)
{
var user = new ParseUser()
{
Username = nombre.Text,
Password = password.Text,
Email = correo.Text
};
user["profesion"] = profesion.Text;
await user.SignUpAsync();
}
示例14: Inscription_Click
private async void Inscription_Click(object sender, RoutedEventArgs e)
{
var user = new ParseUser()
{
Username = UserName.Text,
Password = MDP.Password,
Email = EmailName.Text
};
await user.SignUpAsync();
user["type"] = "student";
Frame.GoBack();
}
示例15: CreateNewUser
void CreateNewUser(string userName, string password, string email)
{
var user = new ParseUser()
{
Username = userName,
Password = password,
Email = email
};
user.SignUpAsync();
Application.LoadLevel("Demo");
}