Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 如何创建在用户指定的日期和时间创建用户指定通知的程序_Windows_Vb.net_Push Notification - Fatal编程技术网

Windows 如何创建在用户指定的日期和时间创建用户指定通知的程序

Windows 如何创建在用户指定的日期和时间创建用户指定通知的程序,windows,vb.net,push-notification,Windows,Vb.net,Push Notification,我正在尝试创建一个Visual Basic Windows窗体程序,该程序在用户指定的日期和时间输出Windows通知(由于此问题,到目前为止,我尚未完成日期和时间部分) 这是我的密码: Imports System.Text Public Class Notifications Sub Main() Dim Toast As New Toast_Notification("Good Morning", "My Title") End Sub Class Toa

我正在尝试创建一个Visual Basic Windows窗体程序,该程序在用户指定的日期和时间输出Windows通知(由于此问题,到目前为止,我尚未完成日期和时间部分)

这是我的密码:

Imports System.Text
Public Class Notifications
    Sub Main()
        Dim Toast As New Toast_Notification("Good Morning", "My Title")
    End Sub

Class Toast_Notification
    Public Sub New(text As String, title As String)
        Dim sbXML As New StringBuilder()
        sbXML.Append("<toast><visual><binding template =""ToastImageAndText01""><text id = ""1"" >")
        sbXML.Append(title & vbNewLine & text)
        sbXML.Append("</text></binding></visual></toast>")
        Dim XMLDoc As New Windows.Data.Xml.Dom.XmlDocument()
        XMLDoc.LoadXml(sbXML.ToString())
        Dim Toast = New Windows.UI.Notifications.ToastNotification(XMLDoc)
        Windows.UI.Notifications.ToastNotificationManager.CreateToastNotifier(title).Show(Toast)
    End Sub
End Class
导入系统文本
公共类通知
副标题()
Dim Toast作为新Toast_通知(“早上好”,“我的头衔”)
端接头
类Toast\u通知
Public Sub New(文本为字符串,标题为字符串)
将sbXML作为新的StringBuilder()进行调整
sbXML.Append(“”)
sbXML.Append(title&vbNewLine&text)
sbXML.Append(“”)
Dim XMLDoc作为新的Windows.Data.Xml.Dom.XmlDocument()
LoadXml(sbXML.ToString())
Dim Toast=New Windows.UI.Notifications.Toast通知(XMLDoc)
Windows.UI.Notifications.ToastNotificationManager.CreateTastNotifier(标题).Show(Toast)
端接头
末级
我试图做的是在用户指定的日期(对于Windows 10计算机)创建一个用户指定的通知,但我一直收到错误

System.Exception:“来自HRESULT:0xC00CE506的异常”

编辑1:console.readline()已在其中,以防止其关闭

编辑2:在绑定后添加一对额外的语音标记


错误代码已消失,但是现在没有显示任何通知

我不知道这是否是问题的原因,但是您的
元素似乎缺少一组引号。你的意思是
?谢谢blackwood,现在错误消失了,但是没有弹出任何通知。这是一个桌面应用程序吗?如果这样做不起作用,则有一些要求。1.应用程序必须在开始屏幕或应用程序视图2中安装快捷方式(但不一定固定)。快捷方式必须具有AppUserModelID 3。桌面应用程序无法安排toast 4。桌面应用程序引发的所有祝酒词都是相同的系统定义颜色5。桌面应用程序无法使用web图像6。桌面应用程序通知不会出现在锁定屏幕上。请参阅更多感谢Codexter,是否有其他方法可以让windows系统显示通知我已找到解决此问题的方法