Xamarin.Android中实现登录信息保存

存储登录信息
ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences (mContext);
ISharedPreferencesEditor editor = prefs.Edit ();
editor.PutBoolean ("key_for_my_bool_value", mBool);// editor.Commit();  
editor.Apply();

读取保存的登录信息
ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences (mContext);
mBool = prefs.GetBoolean ("key_for_my_bool_value", <default value>);
mInt = prefs.GetInt ("key_for_my_int_value", <default value>);
展开阅读全文

没有更多推荐了,返回首页