如何在 .net 中创建可执行文件
我必须每周向订阅者发送一封电子邮件。这封电子邮件的内容来自数据库。我知道我必须在服务器上设置计划任务(我必须要求这样做,因为我远程工作并且没有管理员权限来执行此操作)。我过去就是这样做的,电子邮件是由计划任务调用的 .net 页面发送的。然而我读到这不是最好的方法,我应该创建一个每次调用时运行的可执行文件。如何在 .net、VisualStudio 2008 中创建可执行文件?你能解释一下吗?非常感谢!
I have to send a weekly email to subscribers. The content of this email comes from a database. I understand I have to set up a scheduled task on the server (I have to ask for this as I work remotely and don't have admin rights to do it). I did this in the past, where the email is sent by a .net page that gets called by the scheduled task. However I've read this is not the best way to do it, and that I should create an executable that runs every time it is called. How do I create an executable in .net, VisualStudio 2008? Could you explain? Many thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
发布评论
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
您必须创建一个项目,实现逻辑(根据您的需要对其进行编程)。
您的项目将连接到数据库、检索电子邮件、处理它们、记录所做的事情等...
当您在
project_dir/bin/Debug
或project/bin/Release 中编译项目时
(取决于您编译项目的方式)您将拥有库和可执行文件。如果双击可执行文件,它将启动您的应用程序。您可以将带有依赖库(DLLS)的可执行文件复制到服务器上的某个目录,然后创建计划任务。
You have to create a project, implement the logic (program it to your needs).
Your project will be connecting to database, retrieving emails, processing them, logging what was done, etc...
When you compile your project in
project_dir/bin/Debug
orproject/bin/Release
(depending how you compiled your project) you will have your libraries and executable. If you double click the executable it will launch your application.You can copy your executable with dependent libraries (DLLS) to some directory on the server and then create scheduled task.