There is a need for a system that contains web-side background and WinForm drawing client programs, where users need to be able to start the drawing client on the Web side, and do not need to log on again (because they are already logged on to the web side).
So on IE Web side, how to start WinForm to do the drawing client program? Of course, the same is true for other desktop applications.
The general idea is:
1. Add a button or menu to the ASP.net page, and the connection is to invoke a JavaScript function to implement the startup program
2. The user's environment variable for the client has directory path information for the application
3. WinForm's Drawing client program is able to handle the parameters of the command line passed over, enabling the login to start
Detailed instructions are as follows:
1, the ASP.net page of JavaScript code is as follows:
javascript:Run('EDNMS.UI.exe -u admin -p 4f5a51484e3c639b7c0e606511fe062d5f55aa0509638b385ed179e6d7fe4e9b7342f04c7c74b625574d6aa009693f386cef7b49536c3a4bfb5372675e76bb134f746a84466b7da86703');
<script type= "Text/javascript" language= "JavaScript" >
function Run (command)
{
Window.oldonerror = Window.onerror;
Window._command = command;
Window.onerror = function (err) {
if (Err.indexof (' Automation ')!=-1) {
Alert (' command has been banned by the user! ');
return true;
}
else return false;
};
Try
{
var wsh = new ActiveXObject (' Wscript.Shell ');
if (WSH)
Wsh. Run (command);
Window.onerror = window.oldonerror;
}
catch (E)
{
Alert (' Cannot find the file Ednms-de.exe (or one of its components). Make sure the path and filename are correct and that the required library files are available. ')
}
}
</script>