How to run ASP applications

Source: Internet
Author: User
1. Run the ASP Client Program :
----------------------------------------------------------
ASP runs applications locally through Windows Script Host. There are two available scripting languages: JS and vbs,
The following describes how to run applications in JS and vbs respectively. Code :
[JS]
<Script language = "JavaScript">
<! --
Function rexe (pexe ){
VaR pcmd = new activexobject ("wscript. Shell ");
VaR rexe = pcmd. Exec (pexe );
-->
}
</SCRIPT>
<! --Replace the following ework.exe with your local program path -->
<Input id = rexe type = button style = "Groove" value = "run" onclick = "rexe ('C: \ test \ ework.exe ')">
[Vbs]
<Script language = "vbs">
Function rexe (pexe)
Set pcmd = Createobject ("wscript. Shell ")
Set rexe = pcmd. Exec (pexe)
Set rexe = nothing
End Function
</SCRIPT>
<! --Replace the following ework.exe with your local program path -->
<Input type = button style = "Groove" value = "run" onclick = "rexe ('C: \ test \ ework.exe ')">

To create a wscript sub-object, you must register a DLL file that supports the Automation server and register the command regsvr32 scrrun. dll.
In addition, due to security restrictions, some clients may still encounter the error message "The Automation server cannot create objects" during browsing, this is because the security option in the Intranet option disables "initializing and running scripts for ActiveX controls that are not marked as secure". There is no way to change it to a prompt, or enable it if you are not afraid of danger (no prompt is displayed). We strongly recommend that you do not do this :)

2. Run the server program in ASP:
----------------------------------------------------------
However, when disabling unsigned ActiveX controls, you still cannot use them.
<Script language = "JavaScript">
Run_exe = "<Object ID = \" Runit \ "width = 0 Height = 0 type = \" application/X-oleobject \""
Run_exe + = "codebase = \" test.exe # version = 1, 1, 1 \ ">"
Run_exe + = "<Param name = \" _ version \ "value = \" 65536 \ ">"
Run_exe + = "</Object>"
Run_exe + = "<HTML> Document. open ();
Document. Clear ();
Document. writeln (run_exe );
Document. Close ();
</SCRIPT>

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.