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


C# Org.GetString方法代码示例

本文整理汇总了C#中Org.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# Org.GetString方法的具体用法?C# Org.GetString怎么用?C# Org.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Org的用法示例。


在下文中一共展示了Org.GetString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCompleted

		public async void OnCompleted(Org.Json.JSONObject json, GraphResponse response){
			string tag = "OnCompleted";
			Log.Debug (tag, "Lel, datos :v");
			try{
			string email = json.GetString ("email");
			Log.Debug (tag, "el email debería ser: "+email);

			if (email == "" || email == null || email == "null") {
				//aqui vamos a cachar si no hay email para no hacer el registro.
			} else {

				datosfb.Add ("email", email);

				//ya tenemos todo, ahora podemos mandarlo!, tal vez aqui considere poner la foto de perfil y el nombre en la pantalla

				string resp = await plifserver.PostMultiPartForm ("http://plif.mx/pages/log_reg_face", null, "nada", "file[]", "image/jpeg", datosfb, true);
				Log.Debug (tag,"LA RESPUESTA!!!: "+resp);
        		JsonValue respuesta = JsonValue.Parse(resp);
				//Estructura de respuesta: [{"u":{"id":"225","username":"[email protected]","nombre":"Rutiaga","apellidos":"Cervantes","email":"[email protected]","rol":"cliente","facebook_id":"10204786604253973","puntos":"100"},"iu":{"ruta":"https:\/\/graph.facebook.com\/10204786604253973\/picture?height=800&width=800&migration_overrides=%7Boctober_2012%3Atrue%7D"}}]
				if (respuesta != null) {
					var prefs = this.GetSharedPreferences("RunningAssistant.preferences", FileCreationMode.Private);
					var editor = prefs.Edit ();

					string n=respuesta[0]["u"]["nombre"];
					string ap=respuesta[0]["u"]["apellidos"];

					editor.PutString ("id", respuesta[0]["u"]["id"]);
					editor.PutString ("nombre", n+ap);
					editor.PutString ("email", respuesta[0]["u"]["email"]);
					editor.PutString ("img_perfil", respuesta[0]["iu"]["ruta"]);
					editor.Commit();

					//JA

					//Toast.MakeText (this, "Inicio de sesión correcto", ToastLength.Long).Show();
					StartActivity(typeof(MainActivity));
					Finish();

				} else {
						Toast.MakeText (this, "Há ocurido un inconveniente. Por favor inténtalo de nuevo!", ToastLength.Long).Show();
				}

				

			}
				//CATCH
			}catch(Exception ex){
				Log.Debug ("OnCompleted", "Algo Salio mal en el OnCompleted! " + ex);
				//Toast.MakeText (this, "Algo salió mal. Por favor inténtalo de nuevo.", ToastLength.Long).Show();

				infoface = FindViewById<LinearLayout> (Resource.Id.infoface);
				infologin = FindViewById<LinearLayout> (Resource.Id.infologin);

				infologin.Visibility = ViewStates.Visible;
				infoface.Visibility = ViewStates.Gone;

			}

		}
开发者ID:scrafty614,项目名称:XamarinStudio_Example,代码行数:59,代码来源:login.cs

示例2: OnCompleted

 public void OnCompleted(Org.Json.JSONObject json, GraphResponse response)
 {
     string data = json.GetString("email");
     email.Text = data;
 }
开发者ID:souadbdi,项目名称:TeamEventApp,代码行数:5,代码来源:RegisterAccountActivity.cs


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