C # Web-side start drawing Client for Visio two development and log on

Source: Internet
Author: User
Tags command line

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>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.