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


C# ParseUser.SignUpAsync方法代码示例

本文整理汇总了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);
            }
            
        }
开发者ID:gogodr,项目名称:Trabajo.NET,代码行数:35,代码来源:UsuarioController.cs

示例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();
			}
		}
开发者ID:gautierdelorme,项目名称:JPOINSAXamarin,代码行数:27,代码来源:ParseManager.cs

示例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);
                    }
                }
            });
        });*/
    }
开发者ID:shasnat,项目名称:SportsNews,代码行数:28,代码来源:UserManager.cs

示例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();
    }
开发者ID:rbbernardino,项目名称:spyder,代码行数:31,代码来源:CriarUsuarioParse.cs

示例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;
			}
		});
		
		
	}
开发者ID:shinobushiva,项目名称:Unity-Datastore.Parse,代码行数:31,代码来源:UserAddPanel.cs

示例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");
			}


		}
开发者ID:jonathandao0,项目名称:OfficialVitruvianApp,代码行数:29,代码来源:RegPage.cs

示例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);
         }
     });
 }
开发者ID:heed13,项目名称:CS-3540-Borderlands,代码行数:25,代码来源:loginController.cs

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

示例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;
            }
        }
开发者ID:naturalna,项目名称:TopTen,代码行数:29,代码来源:ExternalDataService.cs

示例10: SignUp

 private void SignUp()
 {
     ParseUser userToSignUp = new ParseUser() {
         Username = CurrentUser.Username,
         Password = CurrentUser.Password
     };
     userToSignUp.SignUpAsync();
 }
开发者ID:ChuckkNorris,项目名称:ToDoDemo,代码行数:8,代码来源:LoginViewModel.cs

示例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();
					}
				}
			}
		}		
开发者ID:ISK-E,项目名称:Debtstroyer,代码行数:60,代码来源:CreateController.cs

示例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();
        }
开发者ID:Kenseco,项目名称:Melo,代码行数:11,代码来源:ParseUserSignUp.cs

示例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();
 }
开发者ID:vivianaraujo,项目名称:DejandoHuella,代码行数:11,代码来源:RegistrarUsuarioPage.xaml.cs

示例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();
 }
开发者ID:denisomlc,项目名称:SoftlabSummerCamp,代码行数:12,代码来源:SignUpPage.xaml.cs

示例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");
	}
开发者ID:reaganq,项目名称:MagnetBots_unity,代码行数:12,代码来源:CreateAccount.cs


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