windows-phone

How to get response body from httpclient c# when doing multipart

痴心易碎 提交于 2019-12-11 05:36:55
问题 I am trying to post multipart data using System.Net.Http.HttpClient, the obtained response is 200 ok. Here is the Method I used: public async Task postMultipart() { var client = new HttpClient(); client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "multipart/form-data"); // This is the postdata MultipartFormDataContent content = new MultipartFormDataContent( ); content.Add(new StringContent("12", Encoding.UTF8), "userId"); content.Add(new StringContent("78", Encoding.UTF8),

Importing XML in a string array - Windows Phone 7

微笑、不失礼 提交于 2019-12-11 05:21:53
问题 I'm using this function to get the data of the xml file to a string array private void ReadXml(string Dictionary, char letter) { XDocument xml = XDocument.Load(Dictionary); string[] dictionary=new string[2]; int i=0; IEnumerable<XElement> de = from el in xml.Descendants(letter.ToString()) select el; foreach (XElement el in de) { dictionary[i++] = el.Value.ToString(); } } But the array that is produced has all the contents of the xml tag I specify merged in its first line. For example the xml

Can one mobile app support multiple different MDMs?

元气小坏坏 提交于 2019-12-11 04:57:17
问题 Can one mobile app support multiple different MDMs (Mobile Device Management solution i.e. Maas360, Airwatch, etc.)? For example one device controlled by MDM 'x' can install it, as well as another device controlled by MDM 'y'. Or is the logic within apps to integrate MDM's not able to differentiate between which specific MDM solution the device is controlled by? 回答1: Yes you can. Each SDK typically has it's own kind of init method so you can build the logic to try..catch that. However,

C# XML Node Works with Element But Not with Elelments

喜你入骨 提交于 2019-12-11 04:49:13
问题 i want to get the child nodes of suras in the following xml data; <suras alias="chapters"> <sura index="1" ayas="7" start="0" name="الفاتحة" tname="Al-Faatiha" ename="The Opening" type="Meccan" order="5" rukus="1" /> <sura index="2" ayas="286" start="7" name="البقرة" tname="Al-Baqara" ename="The Cow" type="Medinan" order="87" rukus="40" /> <sura index="3" ayas="200" start="293" name="آل عمران" tname="Aal-i-Imraan" ename="The Family of Imraan" type="Medinan" order="89" rukus="20" /> <sura

GetStringAsync method in HttpClient throw an exception in WP8

▼魔方 西西 提交于 2019-12-11 03:57:25
问题 Recently, I develop an App for WP8 and at the begining all worked OK. However, since yesterday nigth I was getting an error when trying to retrieve the RSS data from an url. This is part of the code I use to get the data: try { HttpClient client = new HttpClient(); var result = await client.GetStringAsync("http://www.scoop.it/t/recycling-by-miguel18/rss.xml"); var parseResult = XDocument.Parse(result); . . . } catch (Exception ex) { throw new Exception("Error: " + ex.Message); } Where source

Execute some function after raw push notifications is received from server in Window Phone 8.1

帅比萌擦擦* 提交于 2019-12-11 03:33:51
问题 I want to execute my own function when a push notification is received even when the app is not running. And the user doesn't need to click the notification in action bar. In the BackgroundTask.cs I have the following code snippet: namespace BackgroundTasks { public sealed class SampleBackgroundTask : IBackgroundTask { public void Run(IBackgroundTaskInstance taskInstance) { ApplicationDataContainer settings = ApplicationData.Current.LocalSettings; string taskName = taskInstance.Task.Name;

flipviews inside Dynamic listview not swipable

回眸只為那壹抹淺笑 提交于 2019-12-11 03:26:57
问题 I have a listview that is populated during runtime from a webservice. Inside the data template of the listview I have made flipview, each flipview gets three images that user can swipe. I have attached an image of what i am looking for. ISSUE The flipview doesnt get user interactions. here is the xaml below <ListView ManipulationMode="None" IsZoomedInView="False" IsSwipeEnabled="False" > <ListView.ItemTemplate > <DataTemplate> <Grid> <FlipView ItemsSource="{Binding image}" ManipulationMode=

WP8 KnownContactProperties.Birthdate can not set value

筅森魡賤 提交于 2019-12-11 03:22:08
问题 var store = await ContactStore.CreateOrOpenAsync(); StoredContact sc = new StoredContact(store); IDictionary<string, object> values = await sc.GetPropertiesAsync(); values[KnownContactProperties.FamilyName] = "bbb"; values[KnownContactProperties.GivenName]= "worerrrrld"; //*************problem here************** Nullable<DateTime> birth = DateTime.Now; values[KnownContactProperties.Birthdate] = birth; //values[KnownContactProperties.Birthdate] = DateTime.Now; //values[KnownContactProperties

how to add a language in WMAppmanifest file for Windows Phone 8.1

雨燕双飞 提交于 2019-12-11 03:19:53
问题 Its easy to add multiple language support in Windows Phone 8.0 WMAppmanifest file, as it have a list of all languages to select from..... But I dont find any field in 8.1 WMAppmanifest file to add support for multiple language because during app submission on store it says only English supported which is default language. I have added strings resources for different languages but need to find a way to add another language. 回答1: See MSDN Contents of the package manifest Section > Resources By

On Windows Phone “Step Over” exits from async method when I step over async method call with await

心不动则不痛 提交于 2019-12-11 03:14:19
问题 While debugging Windows Phone 8.1 app on device, "Step Over" exits from async method when I step over async method call with await. This does not happen in Windows 8.1 or desktop apps but in Windows Phone apps. Why does this happen? 回答1: This problem was caused by disabled option Suppress JIT optimization on module load . Explained in JIT Optimization and Debugging on MSDN 来源: https://stackoverflow.com/questions/32598151/on-windows-phone-step-over-exits-from-async-method-when-i-step-over