我试图为我的应用程序创建一个协议来启动游戏,但实际上我似乎无法从 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
,键就在那里(我注册的是本文中的键),但它似乎没有启动。我在重新启动计算机后尝试过,它仍然没有。