我在 Windows 服务和 Windows 应用程序中使用了此代码,并且我强制执行“操作已超时”,但是当我在网站中使用此代码时,我从未强制执行异常,有什么问题?!
string con = System.Configuration.ConfigurationManager.ConnectionStrings["TelegramServiceConnectionString"].ConnectionString;
SqlConnection cn = new SqlConnection(con);
SqlDataAdapter da = new SqlDataAdapter("SELECT SH_Message_Sent.phone, SH_Message_Sent.text, SH_Message_Sent.update_id, FaranegarApiUsers.chat_id, FaranegarApiUsers.phone AS Expr1 FROM SH_Message_Sent INNER JOIN FaranegarApiUsers ON SH_Message_Sent.phone = FaranegarApiUsers.phone where SH_Message_Sent.phone='09127218155' order by update_id asc ", cn);
DataSet ds = new DataSet();
da.FillSchema(ds, SchemaType.Source);
da.Fill(ds);
DataTable t = ds.Tables[0];
foreach (DataRow row in t.Rows)
{
WebRequest request2 = WebRequest.Create("https://api.telegram.org/bot99452812:AAE2MntQnStPr_J2KmrOsp_gvGZLZNsy3mE/sendMessage?chat_id=" + row[3] + "&text=" + row[1]);
request2.Timeout = 20000;
WebResponse response2 = request2.GetResponse();
}