C# 通过url访问桌面应用程序

C# 通过url访问桌面应用程序,c#,activex,C#,Activex,通过URL访问桌面应用程序(软件)?我考虑使用visual studio创建一个简单的应用程序,创建active x,如下所示: 要通过url访问应用程序,您必须为特定url注册应用程序,如下所示: public void RegisterURLProtocol(string protocolName, string applicationPath, string description) { // Create new Key for URL Protocol Registry

通过URL访问桌面应用程序(软件)?我考虑使用visual studio创建一个简单的应用程序,创建active x,如下所示:

要通过url访问应用程序,您必须为特定url注册应用程序,如下所示:

public void RegisterURLProtocol(string protocolName, string applicationPath, string description)
{
    // Create new Key for URL Protocol
    RegistryKey myKey=Registry.ClassesRoot.CreateSubKey(protocolName);

    // Assign Protocol
    myKey.SetValue(null, description);
    myKey.SetValue("URL Protocol", string.Empty);

    // Assign Shell Values
    Registry.ClassesRoot.CreateSubKey(protocolName + "\\Shell");
    Registry.ClassesRoot.CreateSubKey(protocolName + "\\Shell\\open");
    myKey = Registry.ClassesRoot.CreateSubKey(protocolName + "\\Shell\\open\\command");

    // Determine App who's receiving the URL calls with params
    myKey.SetValue(null, "\"" + applicationPath,  + "\" %1");
}

祝你今天愉快

我不确定你的问题是什么。ActiveX是一个过时的界面,Microsoft仅出于传统原因支持它。你能帮我给出一个用c#创建ActiveX控件的简单示例代码吗?你发布的链接包含了一个用c#创建ActiveX控件的完整示例。就目前而言,完全不清楚你想要实现什么。“URL”和“ActiveX”完全不相关。也不清楚“访问”对你意味着什么。既然你还没有这么做,请拿着这个。确保阅读理解,为什么这个问题需要修正或删除。