应用程序在服务器上运行,写入 XML 文件 - 它需要是控制台应用程序吗?
我编写了一个应用程序,该应用程序生成 XML 文件,以便使用 Delphi 7 与手机应用程序一起使用。该应用程序是使用表单等开发的。完成后它会退出。它可以按原样每天运行一次吗?还是我必须将其设为控制台应用程序或添加代码以允许它由服务器运行?预定的执行由主机完成。
申请已完成约 60%。
这基本上只是一个提示问题,这样我就能提前知道任何混乱。
有经验的人有一些有用的提示吗?
我也有兴趣知道在服务器环境中写入文件(写入我具有写入访问权限的文件夹)是否需要某种特殊处理。
编辑:完成它(不久前),它写入可通过 http 访问的文件,没有任何问题。 (好吧,将 IE8 配置为每次页面加载都不需要人工干预(受信任的站点/增强的安全性等...))
I've coded an application that generates XML files for use with a mobile phone app using Delphi 7. The application was developed using forms etc. It exits when done. Can this be run once a day as-is, or do I have to make it a console application or add code to allow it be run by the server? The scheduled execution is done by the host.
The application is about 60% done.
It's basically just a heads-up question, so that I know about any snafus beforehand.
Does someone with experience have some helpful tips?
I'm also interested to know if writing files in a server environment (to folders to which I have write access) needs special handling somehow.
Edit: finished it (a while ago) and it writes files accessible via http without any problems. (Well, after configuring IE8 to not require human intervention for every pageload (Trusted Sites/Enhanced Security etc...))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果它是一个带有表单的应用程序,我认为只有在有用户登录服务器时它才会运行。在服务器上,大多数时候没有用户登录。
在后台或服务器上执行操作的应用程序应编码为服务。
If it is an application with a form, I think it will only run if there is a user logged into the server. On server, most of the times there is no user logged in.
Applications that do stuff on the background or on a server should be coded as services.
从任务计划程序运行您的应用程序,您就会没事的。
Run your App from Task Scheduler and you'll be fine.
通常你的图形用户界面(形成东西)只是现有对象的覆盖。如果这个抽象正确实现,您应该能够编写一个小型控制台应用程序,它除了执行您的东西(创建主工作对象并运行任务)之外什么也不做...
一般来说,在服务器..但是如果它不需要交互(点击东西)它应该可以工作...
在服务器上写入文件可能比在本地计算机上有点棘手...除非您的软件在服务器上运行..通常你会使用完整的 URI 访问所有文件,例如 file:///c:/whatever/wherever/
总而言之,这不是一个大麻烦:)
normally your gui (forms stuff) is just an overlay to existing objects. If this abstraction is implemented correctly you should be able to write a small console application, that does nothing but execute your stuff (create main worker object and run the task)...
In general its not a good idea to launch forms applications on a server.. but if it doesn't require interaction (clicking on things) it should work...
Writing files on a server may be a little bit trickier than on a local machine... except your software runs on the server.. Normally you would access all files with a complete URI like file:///c:/whatever/wherever/
All in all its not a big hazle :)