本文整理汇总了C#中Device.GetDeviceId方法的典型用法代码示例。如果您正苦于以下问题:C# Device.GetDeviceId方法的具体用法?C# Device.GetDeviceId怎么用?C# Device.GetDeviceId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Device
的用法示例。
在下文中一共展示了Device.GetDeviceId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnForgotPassword_Click
void btnForgotPassword_Click(object sender, EventArgs e)
{
try
{
var authkey = AppConfig.Auth_Token;
Device device = new Device();
var deviceid = device.GetDeviceId();
LoginStatus status = ForgotPassword(authkey, txtEmail.Text, deviceid);
if (status == LoginStatus.PASSWORD_SEND_SUCCESSFULL)
{
StartActivity(typeof(LoginActivity));
Utilities.ToastMessage(this, Utilities.ToastMessageType.INFO, response.text);
}
else if (status == LoginStatus.INVALID_CREDENTIAL)
{
Utilities.ToastMessage(this, Utilities.ToastMessageType.INFO, "Please enter a valid email" + response.text);
}
else
{
Utilities.ToastMessage(this, Utilities.ToastMessageType.ERROR, "Connection failed, Please check your network connection");
}
}
catch (Exception ex)
{
Utilities.ToastMessage(this, Utilities.ToastMessageType.EXCEPTION, ex.ToString());
}
}
示例2: GetAuthKey
public static string GetAuthKey()
{
string result;
RootObject rootObject;
try
{
Device device = new Device();
device.GetDeviceId();
string inputJson = "{\"deviceid\":\"" + device.Id + "\"}";
var tempJson = Initiate(device.Id, AppConfig.URL_INITIALIZE, inputJson);
rootObject = JsonConvert.DeserializeObject<RootObject>(tempJson);
AppConfig appConfig = new AppConfig(rootObject.authtoken);
result = "INFO:" + rootObject.authtoken.ToString();
}
catch (Exception exception)
{
result = "EXCEPTION:" + exception.Message.ToString();
}
return result;
}