如何定时运行ASP文件 – blueidea.com

看到觉得蛮实用的,就摘录下来了,原文地址是《如何定时运行ASP文件
————————————————–
在一定的时候,要定时的运行某个ASP文件去执行一个任务,如一个工厂在早上9点钟要采集所有的电表的读数,当然这要通过IN SQL连接到各个电表中,我们现在就是用一个ASP文件把IN SQL中表的读数再集中到MS SQL中。
 
可能你看到的定时运行ASP文件的方法有多种,不过我现在要说的是一种简单的方法,利用计划任务就可简单的实现。
 
首先,你要写一个js或者vbs文件来调用你所有执行的ASP。下面是js和vbs文件的代码,你可以任选一个,执行效果是一样的。

  1. 'CODE BY 小荷 aston314@sohu.com
  2. 'Create an instance of IE
  3. Dim IE
  4. Set IE = CreateObject("InternetExplorer.Application")
  5.  
  6. '运行你的 URL
  7.  
  8. ie.navigate("http://www.blueidea.com/")
  9. ie.visible=1
  10.  
  11. 'Clean up...
  12. Set IE = Nothing

你可以取任何名称,但后缀名一定要是vbs,在这里我们取名do.vbs。

  1. //CODE BY 小荷 aston314@sohu.com
  2. // Create the HTML message to display.
  3. var html = "";
  4.     html += "<html><head><title>运行窗口</title></head><body>";
  5.         html += "<font face=verdana></font>";
  6.         html += "</body></html>";
  7.  
  8.  
  9. // Create Internet Explorer Object
  10. ie = new ActiveXObject("InternetExplorer.Application");
  11.  
  12. // Define how the window should look
  13. ie.left       = 50;
  14. ie.top        = 50;
  15. ie.height     = 510;
  16. ie.width      = 470;
  17. ie.menubar    = 0;
  18. ie.toolbar    = 0;
  19.  
  20. // Set the browser to a blank page
  21. ie.navigate("http://www.blueidea.com/");
  22.  
  23. // Show the browser
  24. ie.visible=1;
  25.  
  26. // Open a stream and write data.
  27. //ie.document.open;
  28. //ie.document.write( html );
  29. //ie.document.close;

你也可以取任何名称,但后缀名一定要是js,在这里我们取名do.js。

这里不对文件中的代码进行解说。

只要把上面文件中的所有 http://www.blueidea.com/ 换成你要执行的ASP文件的URL地址就可以了。这里是URL地址,而不是绝对地址。

然后打开 WINDOWS 的任务计划,就象选择任何可执行文件一样选择上面一个do.js或者do.vbs文件所在的位置,设定执行时间等,确定就可以了。

然后这个ASP文件就可以被任务计划定时的运行了,简单吧。

就如开头所说的,任务计划就可以在早上9点,执行这个ASP文件,把电表的读数收集到 MS SQL 中了。

逐步闪烁的文字

  1. <script Language="JavaScript">
  2. <!--
  3. if(navigator.appVersion.charAt(0)>=4 && (navigator.appVersion).indexOf("MSIE")!=-1) isIE4 = true;
  4. else isIE4 = false;
  5. function textAnima_color2(id,n) {
  6. el = document.all.item(id,n);
  7. charColor = el.getAttribute("SET_COLOR");
  8. cur = el.getAttribute("CURRENT_CHAR");
  9. if(cur=="") cur = 0;
  10.  
  11. getHTML= el.getAttribute("SET_TEXT");
  12. if(getHTML == "") {
  13. getHTML = el.innerText;
  14. el.setAttribute("SET_TEXT",getHTML);
  15. }
  16.  
  17. bef_t = getHTML.substring(0,cur); ;
  18. aft_t = getHTML.substring(eval(cur)+1,getHTML.length);
  19. cur_t = getHTML.substr(cur,1);
  20. cur_t = cur_t.fontcolor(charColor);
  21. el.innerHTML = bef_t + cur_t + aft_t;
  22.  
  23. cur++;
  24. if(cur > getHTML.length) cur=0;
  25. el.setAttribute("CURRENT_CHAR",cur);
  26. getT = el.getAttribute("SET_TIME");
  27. if(getT=="") getT = 100;
  28. setTimeout("textAnima_color2('"+id+"',"+n+")",eval(getT));
  29. }
  30.  
  31. if(isIE4) {
  32. window.onload = init;
  33. }
  34.  
  35.  
  36. function init() {
  37. id = "ANIMA_TEXT_COLOR2";
  38. len = document.all.item(id).length;
  39. if(!len) len=1;
  40. for(var i=0;i<len;i++) {
  41. textAnima_color2(id,i);
  42. }
  43. }
  44. //-->
  45. </script>
  46. <b><span style="font-size:14pt;color=red;font-family:新細明體";
  47. id="ANIMA_TEXT_COLOR2" SET_COLOR="yellow"
  48. SET_TIME="100" CURRENT_CHAR SET_TEXT>JAVASCRIPT閃爍文字效果!!!</span>

DIV+CSS文字阴影的一个效果

  1. <style>
  2. ul,li{ margin:0px; padding:0px;list-style-type: none;}
  3. #nav{font-family: Verdana, "宋体", Arial;}
  4. #nav li{ float:left; margin-left:30px;}
  5. #nav span{display:none;}
  6. #nav a{font-size:12px;font-weight: bold;color: #FF6600;text-decoration: none; display:block;}
  7. #nav a:hover{ color:#999;top:1px; left:1px; position:relative;}
  8. #nav a:hover span{ display:block; top:-2px; left:-2px; position:absolute; color:#FF3300;cursor:pointer;}
  9. </style>
  10. <div id="nav">
  11.  <ul>
  12.   <li><a href="#">网站首页<span>网站首页</span></a></li>
  13.   <li><a href="#">网站首页<span>网站首页</span></a></li>
  14.   <li><a href="#">网站首页<span>网站首页</span></a></li>
  15.   <li><a href="#">网站首页<span>网站首页</span></a></li>
  16.   <li><a href="#">网站首页<span>网站首页</span></a></li>
  17.  </ul>
  18. </div>

一个关于网页文字链接的实验  

转自子鼠(zishu.cn)

  1. <style>
  2. /*子鼠 www.zishu.cn*/
  3. body{ font-size:12px; line-height:1.7; margin:50px;}
  4.  
  5. #linka a:link,#linka a:visited {color: #003399;text-decoration: none;margin:0; padding:0; }
  6. #linka a:hover,#linka a:active{color: #000000;text-decoration: none;background-color: #FFCC33;margin:0; padding:0;}
  7.  
  8. #linkb a:link,#linkb a:visited {color: #003399;text-decoration: none; padding-top:3px;}
  9. #linkb a:hover,#linkb a:active{color: #000000;text-decoration: none;background-color: #FFCC33;}
  10.  
  11. </style>
  12. <div id="linka">
  13.  <a href="<a href="http://www.zishu.cn" target="_blank">http://www.zishu.cn</a>">这是链接测试一</a>
  14. </div>
  15.  
  16. <div id="linkb">
  17.  <a href="<a href="http://www.zishu.cn" target="_blank">http://www.zishu.cn</a>">这是链接测试二</a>
  18. </div>

无觅相关文章插件,快速提升流量

下一页 »