Windows Phone Toast通知
时间:2014-06-18 13:24:46
收藏:0
阅读:368
try { string msg = this.richTextBox1.Text; string title = "新通知"; string toastMessage = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<wp:Notification xmlns:wp=\"WPNotification\">" + "<wp:Toast>" + "<wp:Text1>" + title + "</wp:Text1>" + "<wp:Text2>" + this.textBox1.Text + "</wp:Text2>" + "<wp:Param>/Views/MainPage.xaml?NavigatedFrom=ToastNotification" + Uri.EscapeDataString("&title=" + title + "&msg=" + msg) + "</wp:Param>" + "</wp:Toast> " + "</wp:Notification>"; byte[] strBytes = new UTF8Encoding().GetBytes(toastMessage); MsgLabel.Text = "发送中。。。"; SendToastNotification(strBytes); } catch (Exception ex) { MessageBox.Show(ex.Message); }
评论(0)