當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。