アプリケーションの SMS 関数を作成しています。エラーはありませんが、期待どおりではありません。データセットを使用して複数の携帯電話番号を取得しているため、これらすべての携帯電話番号にメッセージを渡す必要があります。
1.Response.Redirectを使用すると、1つのメッセージのみが送信され、他のメッセージは送信されません(最初のメッセージが送信された後、そのページに移動します)
以下のコーディングの一部
DataSet DistDs = _distsms.GetAllDistributionList(UnitId, isShot, gameId, animalTypeId);
if(DistDs.Tables[0].Rows.Count > 0)
{
ContactNo = Convert.ToInt32(DistDs.Tables[0].Rows[0]["ContactNumber"]);
foreach (DataRow row in DistDs.Tables[0].Rows)
{
if (row["ContactNumber"].ToString() != "")
{
try
{
Response.Redirect("http://sms.gatewaysite.com/api/mt?msisdn=" + row["ContactNumber"].ToString() +
"&body=" + msgOut + "&sender=" + shortcode +
"&key=ertyertyer&product_id=4563456&operator=" + oppp + "&country=aaaaa");
}
catch(Exception ee)
{
string a = ee.Message;
//continue;
}
}
}
}