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); }