/// <summary> /// Main page constructor /// </summary> public MainPage() { this.InitializeComponent(); var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); // Hard coding guid for sensors. Not an issue for this particular application which is meant for testing and demos List<ConnectTheDotsSensor> sensors = new List<ConnectTheDotsSensor> { new ConnectTheDotsSensor("2298a348-e2f9-4438-ab23-82a3930662ab", "Light", "L"), new ConnectTheDotsSensor("d93ffbab-7dff-440d-a9f0-5aa091630201", "Temperature", "C"), }; ctdHelper = new ConnectTheDotsHelper(serviceBusNamespace: "SERVICE_BUS_NAMESPACE", eventHubName: "EVENT_HUB_NAME", keyName: "SHARED_ACCESS_POLICY_NAME", key: "SHARED_ACCESS_POLICY_KEY", displayName: deviceInfo.FriendlyName, organization: "YOUR_ORGANIZATION_OR_SELF", location: "YOUR_LOCATION", sensorList: sensors); // Initialize FEZ HAT shield SetupHat(); }
protected async override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); bearer = AccessToken; app_did = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation().Id; try { string red_resource = await GetRedHeartBasicAsync(); if (red_resource == null) { return; } var red_list = JsonHelper.FromJson <RedHeartList>(red_resource); if (red_list == null || red_list.Songs == null || red_list.Songs.Count == 0) { return; } var result_songs = await GetSongDetailsAsync(string.Join("|", red_list.Songs.Select(i => i.SID))); if (result_songs == null) { return; } obse_list = JsonHelper.FromJson <ObservableCollection <SongBase> >(result_songs); ListResources.Source = obse_list; } catch { System.Diagnostics.Debug.WriteLine("fetch red-heart list error."); } finally { IncrementalLoadingBorder.SetVisibility(false); } }
private string GetFeedbackTemplate() { var packageVersion = Package.Current.Id.Version; string version = string.Format("{0}.{1}", packageVersion.Major, packageVersion.Minor); string company = GetCompanyName(this); if (company == null || company.Length <= 0) { company = "<Company>"; } var i = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); var deviceName = string.IsNullOrWhiteSpace(i.FriendlyName) ? "<DeviceName>" : i.FriendlyName; var deviceManufacturer = string.IsNullOrWhiteSpace(i.SystemManufacturer) ? "<DeviceManufacturer>" : i.SystemManufacturer; var deviceHardwareVersion = string.IsNullOrWhiteSpace(i.SystemSku) ? "<DeviceHardwareVersion>" : i.SystemSku; var deviceFirmwareVersion = string.IsNullOrWhiteSpace(i.OperatingSystem) ? "<DeviceFirmwareVersion>" : i.OperatingSystem; // Body text including hardware, firmware and software info string body = string.Format(FeedbackOverlay.GetFeedbackBody(this), deviceName, deviceManufacturer, deviceFirmwareVersion, deviceHardwareVersion, version, company); return(body); }
private async void Page_Loaded(object sender, RoutedEventArgs e) { //Add items to the operator list. this.cbxOperators.Items.Add("Add"); this.cbxOperators.Items.Add("Subtract"); this.cbxOperators.Items.Add("Multiply"); this.cbxOperators.Items.Add("Divide"); this.cbxOperators.SelectedIndex = 0; try { //set binding NetTcpBinding tcpBinding = new NetTcpBinding(); tcpBinding.Security.Mode = SecurityMode.None; tcpBinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows; tcpBinding.Security.Message.ClientCredentialType = MessageCredentialType.None; //new client MyCalculatorClient = new CalculatorClient(tcpBinding, new EndpointAddress("net.tcp://localhost:7991/CalculatorService/Calculator/tcp")); MyCalculatorClient.ClientCredentials.Windows.ClientCredential.UserName = "******"; MyCalculatorClient.ClientCredentials.Windows.ClientCredential.Password = "******"; //bind call back event MyCalculatorClient.ReceiveCalculateResultReceived += MyCalculatorClient_ReceiveCalculateResultReceived; await MyCalculatorClient.OpenAsync(); var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); await MyCalculatorClient.RegisterClientAsync(deviceInfo.FriendlyName); MyCalculatorClient.BroadcastToClientReceived += MyCalculatorClient_ReceiveBroadcastReceived; } catch (Exception ex) { } }
private static string GetDeviceName() { var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); var deviceName = deviceInfo.FriendlyName; return(deviceName); }
public MainPage() { this.InitializeComponent(); //add settings to title bar: Window.Current.SizeChanged += Current_SizeChanged_UpdateTitleBar; CustomizeTitleBar(); customTitleBar.Visibility = Visibility.Collapsed; //get name of device: var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); Settings.Name = deviceInfo.FriendlyName.ToString(); //find server IP: ApplicationDataContainer roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings; Windows.Storage.ApplicationDataCompositeValue composite = (ApplicationDataCompositeValue)roamingSettings.Values["IPConfigs"]; if (composite != null) { Settings.ServerIP = composite["ServerIP"] as string; } //stream event subscriber: Settings.SourceChanged += Stream; //Worker to check for new source: UpdateLoop(); }
/// <summary> /// Creates an instance of an object that allows the caller app to retrieve device information from the local device. /// </summary> public EasClientDeviceInformation() { #if __IOS__ || __TVOS__ _device = UIDevice.CurrentDevice; #elif WINDOWS_UWP || WINDOWS_APP || WINDOWS_PHONE_APP _deviceInformation = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); #endif }
/// <summary> /// Creates an instance of an object that allows the caller app to retrieve device information from the local device. /// </summary> public EasClientDeviceInformation() { #if __IOS__ || __TVOS__ _device = UIDevice.CurrentDevice; #elif WINDOWS_UWP || WINDOWS_APP || WINDOWS_PHONE_APP _deviceInformation = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); #endif }
static string GetUserAgent() { var sysInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); var ai = AnalyticsInfo.VersionInfo; string sv = ai.DeviceFamilyVersion; ulong v = ulong.Parse(sv); ulong v1 = (v & 0xFFFF000000000000L) >> 48; ulong v2 = (v & 0x0000FFFF00000000L) >> 32; string systemVersion = $"{v1}.{v2}"; switch (ai.DeviceFamily) { case "Windows.Desktop": // Edge: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15014 // This: Mozilla/5.0 (Windows NT 10.0; Win64; X64; Microsoft Corporation; Surface Pro 4) String uaArchitecture; switch (Package.Current.Id.Architecture) { case ProcessorArchitecture.X64: uaArchitecture = "Win64; X64"; break; case ProcessorArchitecture.X86: uaArchitecture = "Win32; X86"; break; case ProcessorArchitecture.Arm: uaArchitecture = "ARM"; break; default: uaArchitecture = "Win64; X64"; break; } return($"Mozilla/5.0 (Windows NT {systemVersion}; {uaArchitecture}; {sysInfo.SystemManufacturer}; {sysInfo.SystemProductName})"); case "Windows.Mobile": // Edge: Mozilla/5.0 (Windows Phone 10.0; Android 6.0.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Mobile Safari/537.36 Edge/15.15014 // This: Mozilla/5.0 (Windows Phone 10.0; MicrosoftMDG; RM-1105_12716) return($"Mozilla/5.0 (Windows Phone {systemVersion}; {sysInfo.SystemManufacturer}; {sysInfo.SystemProductName})"); case "Windows.Xbox": // Edge: Mozilla/5.0 (Windows NT 10.0; Win64; x64; Xbox; Xbox One) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393 // This: Mozilla/5.0 (Windows NT 10.0; Win64; X64; Xbox; Xbox One) return($"Mozilla/5.0 (Windows NT {systemVersion}; Win64; X64; Xbox; {sysInfo.SystemProductName})"); default: return($"Mozilla/5.0 (Windows {systemVersion}; {Package.Current.Id.Architecture.ToString()}; {sysInfo.SystemManufacturer}; {sysInfo.SystemProductName})"); } }
public bool isTabletSync() { try { var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); return isTablet(deviceInfo.OperatingSystem); } catch (Exception ex) { return "unknown"; } }
public string getSystemManufacturerSync() { try { var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); return(deviceInfo.SystemManufacturer); } catch (Exception) { return("unknown"); } }
public string getDeviceIdSync() { try { var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); return(deviceInfo.SystemHardwareVersion); } catch (Exception) { return(""); } }
public string getUniqueIdSync() { try { var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); return(deviceInfo.Id.ToString()); } catch (Exception) { return("unknown"); } }
public bool isEmulatorSync() { try { var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); return(deviceInfo.SystemProductName.Equals("Virtual")); } catch (Exception) { return(false); } }
public string getDeviceIdSync() { try { var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); return deviceInfo.SystemHardwareVersion; } catch (Exception ex) { promise.Reject(ex); } }
public bool isTabletSync() { try { var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); return(!deviceInfo.OperatingSystem.Equals("WINDOWS")); } catch (Exception) { return(false); } }
public static string GetDeviceId() { var easId = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation().Id; var engine = Windows.Security.Cryptography.Core.HashAlgorithmProvider.OpenAlgorithm(Windows.Security.Cryptography.Core.HashAlgorithmNames.Md5); byte[] by = easId.ToByteArray(); using (System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(HashSalt.Length + by.Length)) { memoryStream.Write(by, 0, by.Length); memoryStream.Write(HashSalt, 0, HashSalt.Length); return(Windows.Security.Cryptography.CryptographicBuffer.EncodeToHexString(engine.HashData(System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBufferExtensions.GetWindowsRuntimeBuffer(memoryStream)))); } }
/// <summary> /// Main page constructor /// </summary> public MainPage() { this.InitializeComponent(); var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); // Hard coding guid for sensors. Not an issue for this particular application which is meant for testing and demos List <ConnectTheDotsSensor> sensors = new List <ConnectTheDotsSensor> { new ConnectTheDotsSensor(0, "Kg", 0, "Celsius") }; ctdHelper = new ConnectTheDotsHelper(iotDeviceConnectionString: "<enter your connection string here>", sensorList: sensors); }
/// <summary> /// このページがフレームに表示されるときに呼び出されます。 /// </summary> /// <param name="e">このページにどのように到達したかを説明するイベント データ。Parameter /// プロパティは、通常、ページを構成するために使用します。</param> protected override void OnNavigatedTo(NavigationEventArgs e) { // デバイス情報を取得する var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); // 製造メーカーを取得する var manufacter = deviceInfo.SystemManufacturer; // 製品名を取得する var prodactName = deviceInfo.SystemProductName; // OSの名前を取得す var os = deviceInfo.OperatingSystem; }
public MainPage() { AppCenter.Start("51342041-155d-4cb1-a3f6-9ce8dcea6083", typeof(Analytics)); AppCenter.Start("51342041-155d-4cb1-a3f6-9ce8dcea6083", typeof(Push)); this.InitializeComponent(); var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); var deviceName = deviceInfo.FriendlyName; //hide the nav bar scvNavBar.Visibility = Visibility.Collapsed; //set the address to go to String urlString = "https://www.google.co.uk/search?q=enter+url+here"; webView.Navigate(new Uri(urlString)); }
public string getSystemVersionSync() { try { var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); string deviceFamilyVersion = Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamilyVersion; ulong version2 = ulong.Parse(deviceFamilyVersion); ulong major = (version2 & 0xFFFF000000000000L) >> 48; ulong minor = (version2 & 0x0000FFFF00000000L) >> 32; return($"{major}.{minor}"); } catch (Exception) { return("unknown"); } }
/// <summary> /// Main page constructor /// </summary> public MainPage() { this.InitializeComponent(); var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); // Hard coding guid for sensors. Not an issue for this particular application which is meant for testing and demos List <ConnectTheDotsSensor> sensors = new List <ConnectTheDotsSensor> { new ConnectTheDotsSensor("2298a348-e2f9-4438-ab23-82a3930662ab", "Light", "L"), new ConnectTheDotsSensor("d93ffbab-7dff-440d-a9f0-5aa091630201", "Temperature", "C"), }; ctdHelper = new ConnectTheDotsHelper(iotDeviceConnectionString: "IOT_CONNECTION_STRING", organization: "YOUR_ORGANIZATION_OR_SELF", location: "YOUR_LOCATION", sensorList: sensors); }
/// <summary> /// Main page constructor /// </summary> public MainPage() { this.InitializeComponent(); var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); // Hard coding guid for sensors. Not an issue for this particular application which is meant for testing and demos List<ConnectTheDotsSensor> sensors = new List<ConnectTheDotsSensor> { new ConnectTheDotsSensor("2298a348-e2f9-4438-ab23-82a3930662ab", "Light", "L"), new ConnectTheDotsSensor("d93ffbab-7dff-440d-a9f0-5aa091630201", "Temperature", "C"), }; ctdHelper = new ConnectTheDotsHelper(iotDeviceConnectionString: "IOT_CONNECTION_STRING", organization: "YOUR_ORGANIZATION_OR_SELF", location: "YOUR_LOCATION", sensorList: sensors); }
public static async void SendURI() { var ServerName = LocalSettings.LocalSettingsManager.ServerIP; var PortName = LocalSettings.LocalSettingsManager.RNSClientPort; var DeviceID = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation().Id.ToString(); PushNotificationChannel chanel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); System.Diagnostics.Debug.WriteLine(chanel.Uri); System.Diagnostics.Debug.WriteLine(DeviceID); if (chanel.Uri == null) { return; } UWPTCPClient.UWPTCPClient client = new UWPTCPClient.UWPTCPClient(ServerName, PortName); try { await client.ConnectAsync(); } catch { System.Diagnostics.Debug.WriteLine("connect lỗi"); return; } UWPTCPClient.SendAndReceiveResult Result = await client.SendAndRecieveAsync(_FromClientPacketConverter.ObjectToBytes( new SharedModels.NetworkPackets.FromClient.FromClientPacket( SharedModels.NetworkPackets.FromClient.FromClientPacketType.Register, new SharedModels.NetworkPackets.FromClient.RegisterPacketData(DeviceID, chanel.Uri, SharedModels.NetworkPackets.OperatingSystemIDTemplates.Windows10, LocalSettings.LocalSettingsManager.UserName )))); if (Result.IsSuccess) { if (_FromServerPacketConverter.BytesToObject(Result.Data).ResultType == SharedModels.NetworkPackets.FromServer.ServerResult.Success) { System.Diagnostics.Debug.WriteLine("ok"); } else { System.Diagnostics.Debug.WriteLine("ko register được"); } } }
protected async override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); uid = UserID ?? ""; bearer = AccessToken ?? ""; navigateTitlePath.Text = GetUIString("MHzList_Content"); var args = e.Parameter as NavigateParameter; if (args == null) { return; } is_daily = args.IsDailyList; frameType = args.FrameType; listid = Convert.ToInt64(args.ID); app_did = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation().Id; await InitListResourcesAsync(args.ID); }
/// <summary> /// Main page constructor /// </summary> public MainPage() { this.InitializeComponent(); var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); // Hard coding guid for sensors. Not an issue for this particular application which is meant for testing and demos List <ConnectTheDotsSensor> sensors = new List <ConnectTheDotsSensor> { new ConnectTheDotsSensor("SensorL01", "Light", "L"), new ConnectTheDotsSensor("SensorT01", "Temperature", "C") }; //##EDIT ctdHelper = new ConnectTheDotsHelper(iotDeviceConnectionString: "HostName=BCSDemo1.azure-devices.net;DeviceId=FrogPi2;SharedAccessKey=dkcwl/vNsLY0eUZs4+DzGhCiL2SKTrvgJUfIrySQszA=", organization: "PurpleFrogSystems", location: "UK", sensorList: sensors); }
/// <summary> /// Main page constructor /// </summary> public MainPage() { this.InitializeComponent(); var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); // Hard coding guid for sensors. Not an issue for this particular application which is meant for testing and demos List <ConnectTheDotsSensor> sensors = new List <ConnectTheDotsSensor> { new ConnectTheDotsSensor("SensorL01", "Light", "L"), new ConnectTheDotsSensor("SensorT01", "Temperature", "C") }; //##EDIT ctdHelper = new ConnectTheDotsHelper(iotDeviceConnectionString: "<<< Add your IoT hub connection string here >>>", //IoT Hub connection string organization: "PurpleFrogSystems", location: "UK", sensorList: sensors); }
private async void ComposeEmail() { EmailMessage emailMessage = new EmailMessage(); emailMessage.To.Add(new EmailRecipient("*****@*****.**")); string messageSubject = "Whiskly User Feedback"; var sysInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); var ai = AnalyticsInfo.VersionInfo; string sv = ai.DeviceFamilyVersion; ulong v = ulong.Parse(sv); ulong v1 = (v & 0xFFFF000000000000L) >> 48; ulong v2 = (v & 0x0000FFFF00000000L) >> 32; ulong v3 = (v & 0x00000000FFFF0000L) >> 16; ulong v4 = (v & 0x000000000000FFFFL); var timeNow = DateTime.UtcNow; var deviceMan = sysInfo.SystemManufacturer; var deviceMod = sysInfo.SystemProductName; var deviceOS = $"{v1}.{v2}.{v3} ({v4})"; var deviceArch = Package.Current.Id.Architecture; var userID = ""; var userLang = Windows.Globalization.Language.CurrentInputMethodLanguageTag; var userCarrier = ""; var networkStat = NetworkInformation.GetInternetConnectionProfile(); string messageBody = "---" + "\n" + assemblyInformation + "\n" + timeNow + "\n" + "Device Manufactuer: " + deviceMan + "\n" + "Device Model: " + deviceMod + "\n" + "OS: " + deviceOS + "\n" + "Architecture: " + deviceArch + "\n" + "User ID: " + userID + "\n" + "Language: " + userLang + "\n" + "Carrier: " + userCarrier + "\n" + "Network Status: " + networkStat.ServiceProviderGuid; emailMessage.Subject = messageSubject; emailMessage.Body = messageBody; await EmailManager.ShowComposeNewEmailAsync(emailMessage); }
protected override void OnNavigatedTo(NavigationEventArgs e) { String strAux = null; Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); string FriendlyName = deviceInfo.FriendlyName; string OperatingSystem = deviceInfo.OperatingSystem; string SystemManufacturer = deviceInfo.SystemManufacturer; string SystemProductName = deviceInfo.SystemProductName; string SystemFirmwareVersion = deviceInfo.SystemFirmwareVersion; string SystemHardwareVersion = deviceInfo.SystemHardwareVersion; strAux = strAux + "Friendly Name = " + FriendlyName + "\n"; strAux = strAux + "Operating System = " + OperatingSystem + "\n"; strAux = strAux + "System Manufacturer = " + SystemManufacturer + "\n"; strAux = strAux + "System Product Name = " + SystemProductName + "\n"; strAux = strAux + "System Firmware Version = " + SystemFirmwareVersion + "\n"; strAux = strAux + "System Hardware Version = " + SystemHardwareVersion + "\n"; txtResultado.Text = strAux; }
public void AddAdalIdParameters(IDictionary <string, string> parameters) { parameters[AdalIdParameter.Product] = PlatformSpecificHelper.GetProductName(); parameters[AdalIdParameter.Version] = AdalIdHelper.GetAdalVersion(); #if !ADAL_WINPHONE parameters[AdalIdParameter.CpuPlatform] = AdalIdHelper.GetProcessorArchitecture(); #endif #if ADAL_NET parameters[AdalIdParameter.OS] = Environment.OSVersion.ToString(); // Since ADAL .NET may be used on servers, for security reasons, we do not emit device type. #else // In WinRT, there is no way to reliably get OS version. All can be done reliably is to check // for existence of specific features which does not help in this case, so we do not emit OS in WinRT. var deviceInformation = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); parameters[AdalIdParameter.DeviceModel] = deviceInformation.SystemProductName; #endif }
public void AddAdalIdParameters(IDictionary<string, string> parameters) { parameters[AdalIdParameter.Product] = PlatformSpecificHelper.GetProductName(); parameters[AdalIdParameter.Version] = AdalIdHelper.GetAdalVersion(); #if !ADAL_WINPHONE parameters[AdalIdParameter.CpuPlatform] = AdalIdHelper.GetProcessorArchitecture(); #endif #if ADAL_NET parameters[AdalIdParameter.OS] = Environment.OSVersion.ToString(); // Since ADAL .NET may be used on servers, for security reasons, we do not emit device type. #else // In WinRT, there is no way to reliably get OS version. All can be done reliably is to check // for existence of specific features which does not help in this case, so we do not emit OS in WinRT. var deviceInformation = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); parameters[AdalIdParameter.DeviceModel] = deviceInformation.SystemProductName; #endif }
public DeviceDispositions DeviceDisposition() { var x = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); if (x.SystemProductName.Equals("Virtual")) { return(DeviceDispositions.Virtual); } switch (DeviceFamily()) { case DeviceFamilies.Desktop: return(DeviceDispositions.Desktop); case DeviceFamilies.Team: return(DeviceDispositions.Team); case DeviceFamilies.IoT: return(DeviceDispositions.IoT); case DeviceFamilies.Xbox: return(DeviceDispositions.Xbox); case DeviceFamilies.HoloLens: return(DeviceDispositions.HoloLens); case DeviceFamilies.Mobile: { if (IsContinuum()) { return(DeviceDispositions.Continuum); } else if (IsPhone()) { return(DeviceDispositions.Phone); } else { return(DeviceDispositions.Mobile); } } case DeviceFamilies.Unknown: default: return(DeviceDispositions.Unknown); } }
/// <summary> /// Initialize /// Initial the IMEI and HttpClient /// </summary> public void Initialize() { if (string.IsNullOrEmpty(IMEI)) { Random random = new Random(DateTime.Now.Millisecond); for (int i = 0; i < 15; i++) { IMEI += random.Next(10); } var filter = new HttpBaseProtocolFilter(); filter.CacheControl.ReadBehavior = HttpCacheReadBehavior.MostRecent; httpClient = new HttpClient(filter); httpClient.DefaultRequestHeaders.Add("User-Agent", "DailyApi/4 (Linux; Android 5.0.2; MI 2S Build/Xiaomi/aries/aries/LRX22G/zh_CN) Google-HTTP-Java-Client/1.20.0 (gzip) Google-HTTP-Java-Client/1.20.0 (gzip)"); httpClient.DefaultRequestHeaders.Add("x-api-version", "4"); httpClient.DefaultRequestHeaders.Add("x-app-version", "2.6.0"); httpClient.DefaultRequestHeaders.Add("x-os", "Android 5.0.2"); httpClient.DefaultRequestHeaders.Add("x-device", "MI 2S"); var easId = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation().Id; httpClient.DefaultRequestHeaders.Add("x-uuid", easId.ToString()); } }
public static IEnumerable<string> GetSystemInfo() { var sv = AnalyticsInfo.VersionInfo.DeviceFamilyVersion; ulong v = ulong.Parse(sv); ulong v1 = (v & 0xFFFF000000000000L) >> 48; ulong v2 = (v & 0x0000FFFF00000000L) >> 32; ulong v3 = (v & 0x00000000FFFF0000L) >> 16; ulong v4 = (v & 0x000000000000FFFFL); string sysVer = $"{v1}.{v2}.{v3}.{v4}"; var eascdi = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); var resources = ResourceContext.GetForCurrentView(); var lang = resources.QualifierValues["Language"]; var region = resources.QualifierValues["HomeRegion"]; var ver = Package.Current.Id.Version.Major.ToString("0") + "." + Package.Current.Id.Version.Minor.ToString("0") + "." + Package.Current.Id.Version.Build.ToString("0"); return new string[] { "Version = " + sysVer, "Package = " + ver, "Language = " + lang, "HomeRegion = " + region, "EAS ID = " + eascdi.Id, "Friendly Name = " + eascdi.FriendlyName, "OS = " + eascdi.OperatingSystem, "Firmware = " + eascdi.SystemFirmwareVersion, "Hardware = " + eascdi.SystemHardwareVersion, "Manufacturer = " + eascdi.SystemManufacturer, "Product Name = " + eascdi.SystemProductName, "SKU = " + eascdi.SystemSku }; }
public static IEnumerable <string> GetSystemInfo() { var sv = AnalyticsInfo.VersionInfo.DeviceFamilyVersion; ulong v = ulong.Parse(sv); ulong v1 = (v & 0xFFFF000000000000L) >> 48; ulong v2 = (v & 0x0000FFFF00000000L) >> 32; ulong v3 = (v & 0x00000000FFFF0000L) >> 16; ulong v4 = (v & 0x000000000000FFFFL); string sysVer = $"{v1}.{v2}.{v3}.{v4}"; var eascdi = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); var resources = ResourceContext.GetForCurrentView(); var lang = resources.QualifierValues["Language"]; var region = resources.QualifierValues["HomeRegion"]; var ver = Package.Current.Id.Version.Major.ToString("0") + "." + Package.Current.Id.Version.Minor.ToString("0") + "." + Package.Current.Id.Version.Build.ToString("0"); return(new string[] { "Version = " + sysVer, "Package = " + ver, "Language = " + lang, "HomeRegion = " + region, "EAS ID = " + eascdi.Id, "Friendly Name = " + eascdi.FriendlyName, "OS = " + eascdi.OperatingSystem, "Firmware = " + eascdi.SystemFirmwareVersion, "Hardware = " + eascdi.SystemHardwareVersion, "Manufacturer = " + eascdi.SystemManufacturer, "Product Name = " + eascdi.SystemProductName, "SKU = " + eascdi.SystemSku }); }
/// <summary> /// Main page constructor /// </summary> public MainPage() { this.InitializeComponent(); var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); // Hard coding guid for sensors. Not an issue for this particular application which is meant for testing and demos List <ConnectTheDotsSensor> sensors = new List <ConnectTheDotsSensor> { new ConnectTheDotsSensor("2298a348-e2f9-4438-ab23-82a3930662ab", "Light", "L"), new ConnectTheDotsSensor("d93ffbab-7dff-440d-a9f0-5aa091630201", "Temperature", "C"), }; ctdHelper = new ConnectTheDotsHelper(serviceBusNamespace: "SERVICE_BUS_NAMESPACE", eventHubName: "EVENT_HUB_NAME", keyName: "SHARED_ACCESS_POLICY_NAME", key: "SHARED_ACCESS_POLICY_KEY", displayName: deviceInfo.FriendlyName, organization: "YOUR_ORGANIZATION_OR_SELF", location: "YOUR_LOCATION", sensorList: sensors); // Initialize FEZ HAT shield SetupHat(); }
/// <summary> /// return NOKIA **** /// </summary> /// <returns></returns> public static string GetDeviceModelName() { var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); return(string.Format("{0} {1}", deviceInfo.SystemManufacturer, deviceInfo.SystemProductName)); }
/// <summary> /// 获取设备唯一Id /// </summary> /// <returns></returns> public static Guid GetDeviceId() { var easc = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); return easc.Id; }
public string GetDeviceName() { var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); return string.IsNullOrEmpty(deviceInfo.SystemSku) ? string.Format("{0} {1}", deviceInfo.SystemManufacturer, deviceInfo.SystemProductName) : deviceInfo.SystemSku; }
private void ResolveDeviceInformation() { Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation deviceInformation = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); DeviceName = deviceInformation.SystemProductName; Manufacturer = deviceInformation.SystemManufacturer; HardwareVersion = deviceInformation.SystemHardwareVersion; FirmwareVersion = deviceInformation.SystemFirmwareVersion; }
public DeviceDispositions DeviceDisposition() { var x = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); if (x.SystemProductName.Equals("Virtual")) return DeviceDispositions.Virtual; switch (DeviceFamily()) { case DeviceFamilies.Desktop: return DeviceDispositions.Desktop; case DeviceFamilies.Team: return DeviceDispositions.Team; case DeviceFamilies.IoT: return DeviceDispositions.IoT; case DeviceFamilies.Xbox: return DeviceDispositions.Xbox; case DeviceFamilies.HoloLens: return DeviceDispositions.HoloLens; case DeviceFamilies.Mobile: { if (IsContinuum()) return DeviceDispositions.Continuum; else if (IsPhone()) return DeviceDispositions.Phone; else return DeviceDispositions.Mobile; } case DeviceFamilies.Unknown: default: return DeviceDispositions.Unknown; } }
//private async void ResolveSensorCoreAvailabilityAsync() //{ // SensorCoreActivityMonitorApiSupported = await Lumia.Sense.ActivityMonitor.IsSupportedAsync(); // SensorCorePlaceMonitorApiSupported = await Lumia.Sense.PlaceMonitor.IsSupportedAsync(); // SensorCoreStepCounterApiSupported = await Lumia.Sense.StepCounter.IsSupportedAsync(); // SensorCoreTrackPointMonitorApiSupported = await Lumia.Sense.TrackPointMonitor.IsSupportedAsync(); // AsyncOperationComplete(); //} #endregion #region Other hardware properties /// <summary> /// Resolves the device information. /// </summary> private void ResolveDeviceInformation() { #if WINDOWS_PHONE_APP || NETFX_CORE Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation deviceInformation = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); DeviceName = deviceInformation.SystemProductName; Manufacturer = deviceInformation.SystemManufacturer; #if WINDOWS_PHONE_APP HardwareVersion = deviceInformation.SystemHardwareVersion; FirmwareVersion = deviceInformation.SystemFirmwareVersion; #endif #else DeviceName = DeviceStatus.DeviceName; Manufacturer = DeviceStatus.DeviceManufacturer; HardwareVersion = DeviceStatus.DeviceHardwareVersion; FirmwareVersion = DeviceStatus.DeviceFirmwareVersion; #endif }
public override string GetDeviceModel() { var deviceInformation = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); return deviceInformation.SystemProductName; }