新手,求助mono 新手一枚,目前用C#,求mono for andriod读取设备(只读取平板,不包括手机)的序列号、IMEI、MAC等内容,如何下手,请大神指教。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 /// <summary> /// Retrieve the IMEI from the TelephonyManager /// </summary> /// <param name="context"></param> /// <returns></returns> public static string GetDeviceId(Context context) { TelephonyManager telephonyMgr =context.GetSystemService(Context.TelephonyService) as TelephonyManager; string deviceId = telephonyMgr.DeviceId == null ? "UNAVAILABLE": telephonyMgr.DeviceId; return deviceId; } /// <summary> /// Retrieve the PhoneNumber from the TelephonyManager /// </summary> /// <param name="context"></param> /// <returns></returns> public static string GetPhoneNumber(Context context) { TelephonyManager telephonyMgr =context.GetSystemService(Context.TelephonyService) as TelephonyManager; string phoneNumber = telephonyMgr.Line1Number == null ?"UNAVAILABLE" : telephonyMgr.Line1Number; return phoneNumber; } http://stackoverflow.com/questions/15447937/getting-imei-of-a-phone 谢大神,我用其他的方法解决了,你的我试了,好使。string deviceid = TelephonyManager.FromContext(inflater.Context).DeviceId; 新手上路 向winform专家提问?界面刷新问题?C#、自定义控件、GDI(问题解决追加分数100-200) 函数反推 c# winform项目 richtextbox添加控件时控制控件的位置 c#开发窗口程序,能不能引入MVC模式? 想做一个画直线的控件,求思路? 文本文件读写,字符编码的问题 问一个xml的问题 有谁用过Microsoft.MSDN.Samples.UserControls.dbTreeControl?急!!! (Web)DataGrid实现主从表关联,并可以修改从表。万分感谢! 存储过程 MessageBox当点击他的父窗体的时候它会闪烁提示用户,这个功能是如何实现的?
context.GetSystemService(Context.TelephonyService) as TelephonyManager; string deviceId = telephonyMgr.DeviceId == null ? "UNAVAILABLE"
: telephonyMgr.DeviceId; return deviceId; } /// <summary> /// Retrieve the PhoneNumber from the TelephonyManager /// </summary> /// <param name="context"></param> /// <returns></returns> public static string GetPhoneNumber(Context context) { TelephonyManager telephonyMgr =
context.GetSystemService(Context.TelephonyService) as TelephonyManager; string phoneNumber = telephonyMgr.Line1Number == null ?
"UNAVAILABLE" : telephonyMgr.Line1Number; return phoneNumber; }