给Asp.net发电子邮件Cron [英] Email Cron for Asp.net

查看:66
本文介绍了给Asp.net发电子邮件Cron的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,我正在尝试为电子邮件功能运行此cron。相同的代码正在使用另一个系统。







 < span class =code-keyword> var  strURLs =  new 数组(  HTTP://本地主机:51611 /克龙/ Email.aspx); 
var webObj = WScript.CreateObject( MSXML2.ServerXMLHTTP);

var lResolve = 10 * 1000 ;
var lConnect = 10 * 1000 ;
var lSend = 60000 * 1000 ;
var lReceive = 60000 * 1000 ;

webObj.setTimeouts(lResolve,lConnect,lSend,lReceive);

for var i = 0 ; i < strURLs.length; i ++){
webObj.open( GET,strURLs [i], false );
尝试 {
webObj.send();
if (webObj.status!= 200 || String (webObj.statusText).match(/ Database 当前不可用/ gi)!= null ){

}
}
catch (e){
}
}





我按照以下步骤操作:

步骤1:在localhost
步骤2:打开命令提示符

步骤3:运行以下命令

C:\ Windows \ System32> cscript.exeD:\\ \\ Project \ Cron \CronScript.js



我收到以下错误

 Microsoft( R)Windows脚本主机版本 5  8  
版权所有(C)Microsoft Corporation。版权所有。

D:\Projects \Cron \CronScript.js( 1 1
Microsoft JScript运行时错误:' '未定义







请指导我缺少的地方,我很长时间都在寻找这个。

解决方案

嗨朋友们,



我得到了问题的解决方案,它运行正常。



我正在使用Visual Studio 2010 Project作为我的Web应用程序。因此,当我创建任何新页面时,它包含3个文件Default.aspx,Default.aspx.cs,Default.Designer.cs。



但是当我选择新网站时,我只得到Default.aspx和Default.aspx.cs。





上面提到的相同的Cron代码(javascript)对我的同事很好,他正在使用Visual Studio 2010网站。



我复制了相同的文件(没有designer.cs文件),实际上是相同的代码,并添加到我的项目中并且工作正常。



嗯我的Cron动机已经完成,但我仍然感到困惑,为什么它在Project中不起作用,因为它在网站模板中工作。

然后我安排了cscript.exe来运行这个.js文件在Windows任务计划程序中。





请评论并指导我们为什么它不工作,它在同一个项目中工作但有不同的

Hi friends I am trying to run this cron for email functianlity. The same code is working with another system.



var strURLs = new Array("http://localhost:51611/Cron/Email.aspx");
    var webObj = WScript.CreateObject("MSXML2.ServerXMLHTTP");

    var lResolve = 10 * 1000;
    var lConnect = 10 * 1000;
    var lSend = 60000 * 1000;
    var lReceive = 60000 * 1000;

    webObj.setTimeouts(lResolve, lConnect, lSend, lReceive);

    for (var i = 0; i < strURLs.length; i++) {
        webObj.open("GET", strURLs[i], false);
        try {
            webObj.send();
            if (webObj.status != 200 || String(webObj.statusText).match(/Database is currently unavailable/gi) != null) {

            }
        }
        catch (e) {
        }
    }



I follow the steps:
Step1: Run My visual studio project at localhost
Step2: Open the command prompt
Step3: Run the following command
C:\Windows\System32>cscript.exe "D:\Projects\Cron\CronScript.js"

I receive the below error

Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

D:\Projects\Cron\CronScript.js(1, 1) 
Microsoft JScript runtime error: '' is undefined




Please guide me where I am lacking, I am looking for this since long.

解决方案

Hi friends,

I got the solution for the issue and it is working fine properly.

Well I am using Visual Studio 2010 Project for my web application. So when I create any new page it contains 3 files Default.aspx, Default.aspx.cs, Default.Designer.cs .

But when I choose New Website then I get only Default.aspx and Default.aspx.cs.


The same Cron code(javascript) mentioned above working fine for one of my colleague's and he is using Visual Studio 2010 Website.

I copied the same file(without the designer.cs file) with the same code in-fact same letter, and add in my project and it worked.

Well my Cron motive has been accomplished but I am still confused why it didn't work for me in Project as it is working in Website template.
Then I scheduled the cscript.exe to run this .js file in Windows Task Scheduler.


Please comment and guide us why it was not working and it worked in the same project but with a different.


这篇关于给Asp.net发电子邮件Cron的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆