62,074
社区成员
发帖
与我相关
我的任务
分享
private static readonly object obj = new object();
public void ProcessRequest (HttpContext context)
{
context.Response.ContentType = "text/plain";
//context.Response.Write("Hello World");
try
{
lock(obj)
{
string keywords="";
string id="";
Socut.Reader dr = new Socut.Reader("SELECT Top 1 * FROM [Keywords] where isbaidupc <> '1' updatetime<'"+DateTime.Now.ToString("yyyy-MM-dd")+"'");
if (dr.Read())
{
keywords = dr["keywords"].ToString();
id = dr["id"].ToString();
Socut.Data.ExecuteNonQuery("update [Keywords] set isbaidupc='1',updatetime='"+DateTime.Now.ToString("yyyy-MM-dd")+"' where id=" + id);
}
dr.Close();
System.Web.HttpContext.Current.Response.Write(keywords);
}
}
catch(Exception err)
{
//Response.Write(err.Message);
}
}