【问题标题】:Launch application from URI - VB.NET从 URI 启动应用程序 - VB.NET
【发布时间】:2014-01-21 06:52:45
【问题描述】:

我尝试为我的应用程序创建一个协议来启动游戏,但实际上我似乎无法从 URI 启动它。我尝试使用的协议是roblox://,但如果我输入它,它似乎不会启动应用程序,Windows 告诉我它找不到启动 URL 的应用程序。

我使用的代码是:

If (My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator)) Then
    Dim newRegKey As RegistryKey
    newRegKey = Registry.ClassesRoot.CreateSubKey("RobloxProtocol", RegistryKeyPermissionCheck.ReadWriteSubTree)
    newRegKey.SetValue("", "URL:roblox")
    newRegKey.SetValue("URL Protocol", "")
    Dim newRegCom As RegistryKey
    newRegCom = newRegKey.CreateSubKey("shell\open\command")
    newRegCom.SetValue("", """" & Application.ExecutablePath & """" & " -id " & """" & "%1" & """")

    warnText.Text = "ROBLOX Protocol Launcher is installed!"
Else
    warnText.Text = "Please run ROBLOX Protocol Launcher as Administrator to finish the install process."
End If

如果我使用regedit 在注册表中查看,键就在那里(我注册的是来自this article 的键),它似乎没有启动。重启电脑试了下还是不行。

【问题讨论】:

    标签: vb.net url uri protocols roblox


    【解决方案1】:

    在您引用的文章中,HKCR下的子键名称为alert,其中启动的url为alert://...

    将您的子键更改为roblox 而不是RobloxProtocol(或尝试从robloxprotocol:// 启动

    【讨论】:

    • @celliot1997:没问题。
    猜你喜欢
    • 1970-01-01
    • 2014-05-06
    • 2012-06-20
    • 2018-10-22
    • 1970-01-01
    • 1970-01-01
    • 2012-11-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多