This article introduces how to accurately run ASP files. Let’s take a look at the detailed tutorial below. Friends who need it can refer to it.
At a certain time, we need to run an ASP file regularly to perform a task. For example, a factory needs to collect all the readings of the meter at 9 o'clock in the morning. Of course, this needs to be connected to each meter through IN SQL. We are now using an ASP file to concentrate the readings of the tables in IN SQL into MS SQL.
Maybe you have seen a variety of ways to run ASP files at a time, but what I want to talk about now is a simple method that can be simply implemented using the planned tasks.
First, you need to write a js or vbs file to call all the ASPs you execute. Below is the code for js and vbs files. You can choose any of them, and the execution effect is the same.
vbs code ----------------------------------------------------------------------------------------------------------------------------
'CODE BY Xiaohe [email protected]
'Create an instance of IE
Dim IE
Set IE = CreateObject("InternetExplorer.Application")
'Run your URL
ie.navigate("http://www.knowsky.com/")
ie.visible=1
'Clean up...
Set IE = Nothing
--------------------------------------------------------------------------------------------------------------------------------
You can take any name, but the suffix must be vbs, here we name do.vbs.
js code ---------------------------------
var html = "";
html += "
";
html += "";
html += "";
// Create Internet Explorer Object
ie = new ActiveXObject("InternetExplorer.Application");
// Define how the window should look
ie.left = 50;
ie.top = 50;
ie.height = 510;
ie.width = 470;
ie.menubar = 0;
ie.toolbar = 0;
// Set the browser to a blank page
ie.navigate("http://www.knowsky.com/");
// Show the browser
ie.visible=1;
// Open a stream and write data.
//ie.document.open;
//ie.document.write(html);
//ie.document.close;
--------------------------------------------------------------------------------------------------------------------------------
You can also take any name, but the suffix must be js. Here we name do.js.
The code in the file is not explained here.
Just replace all http://www.knowsky.com/ in the above file with the URL address of the ASP file you want to execute. Here is the URL address, not the absolute address.
Then open the task plan of WINDOWS, just like selecting any executable file, select the location of the do.js or do.vbs file above, set the execution time, etc., and then confirm.
Then this ASP file can be run regularly by the task schedule, it's simple.
As mentioned at the beginning, the task plan can execute this ASP file at 9 a.m. and collect the meter readings into MS SQL.
The above is an introduction to how to accurately run ASP files. I hope the relevant knowledge and materials compiled by the editor will be helpful to you. For more content, please continue to pay attention to the website of the Wrong New Technology Channel!