Launch a .NET DLL from an ASP.NET page
I'm working with a intranet website written in ASP.NET and need to be able to access a DLL that is installed on the user's computer. I can get it working if I'm hosting the site locally but when I try to access it from another machine it does not work. I realize this could be a dangerous tool to u开发者_运维百科se but if you have a valid business purpose for doing this, is it possible?
I've looked around and there might be a way to use JavaScript to do this but I'm wondering if there is anything else.
To make it work locally I had to add AspCompat to the page so the first like looks like:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebApplication1._Default" AspCompat="True" %>
Any help would be greatly appreciated.
Even with a valid reason, I'd find another way, like having them download an .exe. Think of it this way. Even if you REALLY needed to loan your car to someone, would you leave it at the mall unlocked with keys in the ignition all day until they could pick it up? Because that's what you'll have if you find a way to change their security to allow this .dll execution.
I think you have two options:
1: get a copy of the user machine's dll and include into your asp.net web application, via adding a reference to it. keep in mind that this dll will be executing from your web server machines, thus cannot access local resources on user's machines beyond what is available from a web browser.
2: rewrite your web application into a desktop application (windows forms, or WPF), and deploy it via ClickOnce or XBAP etc.
I don't think Javascript will allow you to invoke a dll in client local computer, unless of course you already have an ActiveX plugin or something installed.
精彩评论