【发布时间】: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