////// 获取唯一id(网卡id) 替代imei /// ///internal static string GetUniqueId() { try { var connectionProfile = NetworkInformation.GetInternetConnectionProfile(); var networkAdapter = connectionProfile.NetworkAdapter; return networkAdapter.NetworkAdapterId.ToString(); } catch { return ""; } } /// /// 格林威治时间 /// ///internal static string GetTime() { return Decimal.ToInt64(Decimal.Divide(DateTime.UtcNow.Ticks - 621355968000000000, 10000)).ToString(); } /// /// 应用程序包名或程序名称 /// ///internal static string GetPKG() { try { Package package = Package.Current; PackageId packageId = package.Id; return packageId.Name; } catch { return ""; } } /// /// 获得网络类型 /// ///internal static string GetNettype() { try { //http://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.connectivity.networkadapter.ianainterfacetype.aspx var profile = Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile(); var interfaceType = profile.NetworkAdapter.IanaInterfaceType; if (interfaceType == 71) { return "Wifi"; } else if (interfaceType == 6) { return "Ethernet"; } else { return "other"; } } catch { return ""; } } /// /// API的版本号 /// ///internal static string GetApiVersion() { try { AssemblyFileVersionAttribute MyAssemblyFileVersionAttribute = typeof(MainPage).GetTypeInfo().Assembly.GetCustomAttribute (); return MyAssemblyFileVersionAttribute.Version; } catch { return ""; } } /// /// 获取设备名称 /// ///internal static async Task GetModel() { try { if (DeviceModel!=null) { return DeviceModel; } string[] properties = { "System.Devices.ModelName" }; var containers = await PnpObject.FindAllAsync(PnpObjectType.DeviceContainer, properties); foreach (PnpObject container in containers) { if (container.Id.Equals("{00000000-0000-0000-FFFF-FFFFFFFFFFFF}")) { DeviceModel = container.Properties["System.Devices.ModelName"].ToString(); return DeviceModel; } } return ""; } catch { return ""; } } /// /// 终端屏幕分辨率 /// ///internal static string GetResolution() { try { Rect ret = Window.Current.CoreWindow.Bounds; return ret.Width + "*" + ret.Height; } catch { return ""; } }
现在没有找到
1、获得os系统信息的api
2、获得app 开启那些权限(如定位,读写文件等权限)信息的api
如果你有更好的方式或者有办法还请留言互相交流!~