问:如同图像我上传出的话,请给我的信息怎么办SMS应用一样的..
觉得有存在的GridView列像它(从Excel到GridView中获得DATAS)
| NAME | SURNAME | AGE | FINALSCORE |
JOHN GATES 33 85
COLINS GATEWAY 25 75
当我发送短信时: "DEAR MR. {NAME} {SURNAME} YOUR AGE IS {AGE} . AND YOUR FINAL SCORE IS {FINALSCORE} . SINCERELY.."
消息发送时:
"DEAR MR. JOHN GATES YOUR AGE IS 33 . AND YOUR FINAL SCORE IS 85 . SINCERELY.."<br />
"DEAR MR. COLINS GATEWAY YOUR AGE IS 25 . AND YOUR FINAL SCORE IS 75 . SINCERELY.."
答:<pre lang="c#">
protected void Button1_Click(object sender, EventArgs e)
{
foreach (GridViewRow gr in GridView1.Rows)
{
string name = gr.Cells[0].Text;
string surname = gr.Cells[0].Text;
string age = gr.Cells[0].Text;
string score = gr.Cells[0].Text;
string finalMsg = "DEAR MR. " + name + " " + surname + ".YOUR AGE IS " + age + " . AND YOUR FINAL SCORE IS " + score + " . SINCERELY..";
//Function to send message
msgSend(finalMsg );
}
}
使用此代码。它将起作用。