我尝试为我的应用程序创建一个协议来启动游戏,但是我似乎无法通过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
查看注册表,键是存在的(我注册的是这篇文章中的那些键),但似乎并没有启动。我尝试过重新启动计算机,但仍然无法启动。