摘要: To encrypt the PIN // Convert the PIN to a byte[]. byte[] PinByte = Encoding.UTF8.GetBytes(TBPin.Text); // Encrypt the PIN by using the Protect() method. byte[] ProtectedPinByte = ProtectedData.Protect(PinByte, null); // Store the encrypted PIN in isolated storage. this.WritePinToFi... 阅读全文
posted @ 2013-11-20 05:40 MinieGoGo 阅读(183) 评论(0) 推荐(0) 编辑
摘要: var response = await httpClient.PostAsync(endpoint, new FormUrlEncodedContent(parameters)); var result = await response.Content.ReadAsStreamAsync(); var reader = new StreamReader(result); var str = reader.ReadToEnd(); //if (response.Content != ... 阅读全文
posted @ 2013-11-19 06:40 MinieGoGo 阅读(222) 评论(0) 推荐(0) 编辑
摘要: public void GetValueFromRequest(string postData) { var request = (HttpWebRequest) WebRequest.CreateHttp("http://login.test.geoop.com/oauth2/token"); byte[] requestBytes = Encoding.UTF8.GetBytes( postData); request.Metho... 阅读全文
posted @ 2013-11-19 04:58 MinieGoGo 阅读(387) 评论(0) 推荐(0) 编辑
摘要: Sorting outside the collection protected override void OnNavigatedTo(NavigationEventArgs e) { if (Settings.AscendingSort.Value) { App.PictureList.Pictures = new ObservableCollection(App.PictureList.Pictures.OrderBy(x => x.DateTaken)) as System.Collections.IList; ... 阅读全文
posted @ 2013-11-17 16:18 MinieGoGo 阅读(969) 评论(0) 推荐(0) 编辑
摘要: I/O should use async, asynchronous method can be achieved:message, delegate, multi-threadingThread-safe1. private void button_Click(object sender, EventArgs e) 2. { 3. var task = new Task(() => 4. { 5. this.lblResult.Invoke(new Action (() => { 6. ... 阅读全文
posted @ 2013-11-14 09:49 MinieGoGo 阅读(328) 评论(0) 推荐(0) 编辑
摘要: Sometime you may want to uniquely identify a Windows Phone, such as when you are implementing push notifications. The best way to identify a unique Windows Phone is through its device GUID.The following code snippet shows how to obtain the GUID of a Windows Phone device:using Microsoft.Phone.Info; p 阅读全文
posted @ 2013-11-13 16:00 MinieGoGo 阅读(218) 评论(0) 推荐(0) 编辑
摘要: One of the most common tasks you need to perform in a Windows Phone application is updating the UI from a separate thread.For example, you may be download some content asynchronously using a WebClient class and when the operation is completed, you want to update the UI with the content that was down 阅读全文
posted @ 2013-11-13 15:50 MinieGoGo 阅读(233) 评论(0) 推荐(0) 编辑
摘要: JavaScript Closurefunction f1(){ var n=999; return function(){ alert(n); // 999 return n; }} var a =f1(); alert(a());C# Closure static void Main(string[] args) { var a = new TClosure(); var b = a.T1(); Console.WriteLine(b()); } ... 阅读全文
posted @ 2013-11-13 06:13 MinieGoGo 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Find the place where B is used, and use C to call C.BRootFrame.Navigated += CheckForResetNavigation;ViewModelLocator.InitialiseRootFrame(RootFrame); public void InitialiseRootFrame(PhoneApplicationFrame rootFrame) { containerLocator.Container.RegisterType(new InjectionConstructor(r... 阅读全文
posted @ 2013-11-11 10:22 MinieGoGo 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Basically ToastPrompt is an UI component that derives from the Coding4Fun toolkit's abstract PopUp class.It is a kind of extended popup that runs in foreground, performs toast like notification: when a background process (such as an async download) has completed notifies the user. ToastPrompt to 阅读全文
posted @ 2013-11-10 07:57 MinieGoGo 阅读(192) 评论(0) 推荐(0) 编辑