[英]ASP.NET - Cron job with password protected page
I am trying to read an xml-feed into a database on a specific time with cron jobs. 我正在尝试使用cron作业在特定时间将xml提要读取到数据库中。 Everything is working fine (the cron job calls the page and the xml-script starts running and reading into the database) except that i dont want someone else to be able to run the script by visiting this page.
一切工作正常(cron作业调用该页面,并且xml脚本开始运行并读取到数据库中),除了我不希望其他人能够通过访问此页面来运行该脚本。 Therefore I have been looking at setting up a password-protected page for this script, but there is not a lot of information about how to do this with cron jobs and asp.net.
因此,我一直在为该脚本设置一个受密码保护的页面,但是关于如何使用cron作业和asp.net进行此操作的信息并不多。
It seems to be so much easier with php (use the htaccess-file and send the username and password with the cron-job url like http://username:password@yoursite.com/cron ). 用php似乎要容易得多(使用htaccess-file并使用cron-job url发送用户名和密码,例如http:// username:password@yoursite.com/cron )。 Is it possible to do this with asp.net sites?
使用asp.net网站可以做到这一点吗?
I have to use cron job since my web hosting provider don't have windows task scheduler. 我必须使用cron作业,因为我的网络托管提供商没有Windows Task Scheduler。
Thanks, Axel 谢谢,阿克塞尔
您可以在特定于目录的web.config中使用通过保护的URL
Two points come to my mind 我想到两点
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.