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


C# Credentials.doLogin方法代码示例

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


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

示例1: TryToLogin

		/// <summary>
		/// This method takes care of the login process
		/// </summary>
		/// <param name="username"> the user's username, gotten from the gui</param>
		/// <param name="password"> the user's password, gotten from the gui</param>
		/// <returns> whether or not the user was successfully logged in</returns>
		private async Task<Boolean> TryToLogin (string username, string password)
		{
			try
            {
				credentials = new Credentials (username);

                //Try to log the user into the system
				if (await credentials.doLogin(password, serverURL + login_ext))
                {
                    //If the login was successful, update the user's GCM id
					return await Updater.UpdateObject (new { token = credentials.token, username = username, gcm_regid = gcm_token }, serverURL + gcm_regid_ext);
				}
                else
                {
					return false;
				}
			}
            catch
            {
				return false;
			}
		}
开发者ID:Byuunion,项目名称:Senior_project,代码行数:28,代码来源:MainActivity.cs


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