我有一个名为Winbox的小型Windows应用程序(它是控制RouterBoard的微型应用程序)。
我们正在制作一个Web应用程序,它需要创建一个自定义协议URL,例如:

oxo://192.168.103.3 {USERNAME} {PASSWORD}


我只需要将oxo://指向[c:/winbox.exe]并使用参数{IP地址} {USERNAME} {PASSWORD}执行该应用程序

所以我已经编辑了注册表编辑器代码:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\oxo]
@="\"URL:oxo Protocol\""
"EditFlags"=hex:02,00,00,00
"URL Protocol"=""

[HKEY_CLASSES_ROOT\oxo\DefaultIcon]
@="\"C:\\winbox.exe\",0"

[HKEY_CLASSES_ROOT\oxo\shell]

[HKEY_CLASSES_ROOT\oxo\shell\open]

[HKEY_CLASSES_ROOT\oxo\shell\open\command]
@="\"C:\\winbox.exe\" \"%1\""


但是问题是在浏览器中打开URL时,它将在{IP ADDRESS}字段中显示“ oxo:// {IP ADDRESS}”。
哪个不起作用

我需要做的是从最终的可执行路径中删除协议名称“ oxo://”的第一部分

如果要下载Winbox.exe:
http://download2.mikrotik.com/winbox.exe

用法:

winbox.exe {IP ADDRESS} {USERNAME} {PASSWORD}




{IP ADDRESS} : Is the IP Address of the remote RouterBaord device.
{USERNAME} : Is the username of the RouterBoard Device.
{PASSWORD} : Is the password of the RouterBoard Device.


请即使在JAVA,C,C ++或任何编程语言中,也需要有关此问题的任何帮助。

我只想使用来自网络浏览器的参数运行exe文件。

非常感谢,
阿雷卜

最佳答案

您的链接包含动态参数,
制作oxo的关键是打开控制台应用程序
并且您可以为控制台应用程序使用此代码将应用程序重定向到winbox.exe

 Sub Main()
        On Error Resume Next
        Dim url As String = Command()
        url = url.Replace("/", "")
        url = url.Replace("oxo", "")
        url = url.Replace(":", "")
        Dim arg() As String = url.Split(",")
        Dim IP As String = arg(2)
        Dim Username As String = arg(1)
        Dim Password As String = arg(0)
        Shell("c:\winbox\winbox.exe " & IP & " " & Username & " " & Password)
        Console.WriteLine("Yout username : " & Username & " Password : " & Password & " Ip : " & IP)
    End Sub


和您的链接将是

oxo://{PASSWORD},{USERNAME},{IP}

关于java - 在注册表编辑器中为MikroTik Winbox添加自定义协议(protocol),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/16845085/

10-08 23:33