在托管服务器上以 URL 形式运行日常作业
我有一个托管网站和一个 ASP.NET MVC 网站。托管公司允许您设置“计划任务”,这些任务基本上只使用 Windows 调度程序。该服务以您想要的任意时间间隔检查 URL,但您只能提供 URL。
我想要一份运行数据库查询并将某个表的结果通过电子邮件发送给我的工作。
我的问题是我如何拥有一个可以运行代码以通过电子邮件发送的 URL,因为在这种情况下我显然不需要返回到视图的任何 html,因为它只是运行一个任务。
i have a hosted web site and i have an asp.net mvc site. The hosting company allows you to setup "scheduled tasks" which are basically just using the windows scheduler. The service checks a URL at whatever interval that you want but all you can supply it is a URL.
i want to have a job that runs a db query and emails out to me the results of a certain table.
My questions is how do i have just a URL that can go and run code to email out as i obviously dont need any html returned to a view in this case as its just running a task.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建一个控制器,其方法将查询数据库并向您发送电子邮件并将其映射到某个路由。并使用你映射的url作为url进行检查。一切都应该有效。
或者可能是我只是不明白你的问题。在这种情况下,请更新问题并提供一些详细信息。
Create a controller with a method that will query the database and send you an email and map it to some route. And use the url you mapped to as an url to check. And all should work.
Or may be I just don't understand your question. In this case please update the questions with some details.