关于asp.net中的windows服务
我要做一个彩票网站,我需要自动开奖 所以我想要做一个windows服务去抓取其他网站的开奖号码 因为他是10分钟跳一次,开一次奖的 我想问一下 我应该怎么去用时间控制windows服务让他每10分钟 抓开一次奖? 希望知道的朋友给出比较详细的回答 O(∩_∩)O谢谢!!
Thread.Sleep(10*60*1000) ?引用 Thread.Sleep(10*60*1000) ? 用这个就可以了吗 ?也就是每10分钟沉睡一次/? Timer定时执行 HttpWebrequest抓取网页内容,再用正则根据html格式获取数据 System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url); request.UserAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)"; System.Net.WebResponse response = request.GetResponse(); System.IO.Stream resStream = response.GetResponseStream(); System.IO.StreamReader sr = new System.IO.StreamReader(resStream, encoding); string html = sr.ReadToEnd(); resStream.Close(); 用System.Timers.Timer,长延时循环用Thread.Sleep很不规范也不合适...引用 Timer定时执行 HttpWebrequest抓取网页内容,再用正则根据html格式获取数据 System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url); request.UserAgent = "Mozilla/4.0 (compat
相关问答:
select top 12 * from Product where [id] not in (select top 12 [id] from Product) 这样可以分页,但是我在后面想加个条件 select top 12 * from Product where [id] not in (select top 12 [id] from Prod ......
function CheckOpwd(){//验证用户名 var pwd=document.all.txtOpwd; var div1=document.getElementById("divPwd"); if (pwd.value=="") { ......
静态模板: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/ ......
从数据库中查询一张表的数据 select 部门,姓名 from tb 如何才能生成下面的xml格式文件 <folder state="unchecked" label="全部"> <folder state="unchecked" isBra ......
这些天为做报表而苦闷,几种方案都没有如意。 方案1,直接在网页中用TABLE,浏览可以,但格式不容易做得灵活,印涉及多页时中间的页会没头没尾后面的页则没头, 方案2,用OWC在页内嵌入EXCEL表格,但它操作起来就那么别扭 ......