asp.net中的调度程序 [英] Scheduler in asp.net

查看:83
本文介绍了asp.net中的调度程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个调度程序,它将从asp.net发送电子邮件和短信。



我在sql server中有以下格式的数据库。



userid emailid Mobileno日期时间ReminderBody

1 abc@gmail.com 98797 23/08/13 8.30你的Id将于2013年8月23日到期续订。

2 xyz@gmail.com 98797 23/08/13 8.30你的Id将于2013年8月23日到期更新。



等等。



我的短信和电子邮件将根据数据库发送。



i需要安排任务按照日期。



请帮我解决问题。

I need a scheduler which will send email and SMS from asp.net.

I have database in the following format in sql server.

userid emailid Mobileno date time ReminderBody
1 abc@gmail.com 98797 23/08/13 8.30 ur Id will expire on 23/08/13 renew it.
2 xyz@gmail.com 98797 23/08/13 8.30 ur Id will expire on 23/08/13 renew it.

and so on.

my SMS and email will be send on the basis of database.

i need to schedule a task as per the date.

please help me solve the problem.

推荐答案

使用vbs文件调用特定页面,如粗体所示,然后调用windows任务调度程序,它将在附件的系统工具中提供并安排此vbs文件。



调用LogEntry()



Sub LogEntry()



'强制脚本完成错误。

错误继续下一步



'声明变量

Dim objRequest

Dim URL



设置objRequest = CreateObject(Microsoft.XMLHTTP)



'将附加变量的URL链接放在一起。

URL =http:// localhost:15559 / WebForm1.aspx

'O写下HTTP请求并将URL传递给objRequest对象

objRequest.openPOST,URL,false



'发送HTML请求

objRequest.Send



'将对象设置为空

设置objRequest = Nothing



End Sub
use vbs file which will call specific page as specified in bold then called windows task scheduler which will be available in system tool of accessories and schedule this vbs file.

Call LogEntry()

Sub LogEntry()

‘Force the script to finish on an error.
On Error Resume Next

'Declare variables
Dim objRequest
Dim URL

Set objRequest = CreateObject("Microsoft.XMLHTTP")

'Put together the URL link appending the Variables.
URL = "http://localhost:15559/WebForm1.aspx"
'Open the HTTP request and pass the URL to the objRequest object
objRequest.open "POST", URL , false

'Send the HTML Request
objRequest.Send

'Set the object to nothing
Set objRequest = Nothing

End Sub


创建SQL Server作业并调用存储过程作为其步骤。通过存储过程,发送电子邮件。请参阅这些链接。



如何:创建作业(SQL Server Management Studio) [ ^ ]



如何:安排工作(SQL Server Management Studio) [ ^ ]



如何每天运行存储过程在SQL Server中? [ ^ ]



问候..:)
Create a SQL Server Job and call stored procedure as its step. Through stored procedure,send email.Refer these links.

How to: Create a Job (SQL Server Management Studio)[^]

How to: Schedule a Job (SQL Server Management Studio)[^]

How to run a stored procedure every day in SQL Server?[^]

Regards..:)


这篇关于asp.net中的调度程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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