如何运行WCF的程序? [英] How to run a program in WCF?

查看:117
本文介绍了如何运行WCF的程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的WCF和我设计的,我想运行一个爬虫程序(在C#codeD)的爬虫一些网站上一个项目,它存储的数据库表中的爬网数据(SQL Server数据库)。我想这履带30分钟后重复运行和更新数据库。

I am new to WCF and i am designing a project in which i want to run a crawler program (coded in c#) which crawlers some websites and it stores the crawled data in the tables of database (sql server db). I want that crawler runs repeatedly after 30 minutes and updated the database.

我想,然后使用我的托管平台上的服务,这样我可以在Web表单表(即.aspx页面中)

I want to then use the service on my hosted platform so that i can use the data from tables in web form (i.e. .aspx page)

什么情况下可以使用WCF实现这个功能?

Is it okay to use WCF for this purpose ?

请建议我如何继续?

感谢

推荐答案

您可以使用WCF服务要做到这一点,但我会去另一个设置:

You could use a WCF service to do this but I would go for another setup:


  1. 我想建立一个预定的Windows计划任务每​​30分钟运行Windows应用程序。一个简单的控制台应用程序可能会被罚款。

  1. I'd build a Windows application that is scheduled to run every 30 minutes by the Windows Task Scheduler. A simple console application might be fine.

我会使用一个Web应用程序(可能是ASP MVC)查询数据库。

I'd use a Web application (possibly ASP MVC) to query the database.

正如你可以看到有没有必要使用WCF的。

As you can see there is no need to use WCF at all.

这是异常可以/必须作出当服务器是不是你的,但你用的是托管服务提供商谁也不让你安排Windows任务。在这种情况下,你可能希望通过Web应用程序运行用手爬行过程,并把它30分钟后重演。

An exception can/must be made when the server is not yours but you are using a hosting provider who doesn't allow you to schedule a Windows task. In that case you might want to run the crawling process by hand through the web application and have it repeat itself after 30 minutes.

一些托管服务提供商可以做任务的调度,但以不同的方式因此它可能是值得进行调查。

Some hosting providers do allow the scheduling of tasks but in a different way so it might be worth to investigate.

这篇关于如何运行WCF的程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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