有一段VB代码看不懂,请大家帮忙看一下!
For i = 1 To Request.Form( "content1 ").Count
sContent1 = sContent1 & Request.Form( "content1 ")(i)
Next
Response.Write "编辑内容如下: <br> <br> " & sContent1
Response.Write " <br> <br> <p> <input type=button value= ' 退回 ' onclick= 'history.back() '> </p> "
以上代码转成C#的话,如何编写?
[解决办法]
string sContent1 = Request.Form[ "content1 "];
[解决办法]
for(int i=1;i <Convert.ToInt32(Request.Form( "content1 ").Count);i++)
{
sContent1 = sContent1 + Request.Form( "content1 ")[i].ToString();
}
Response.Write ( "编辑内容如下: <br> <br> " + sContent1);
Response.Write ( " <br> <br> <p> <input type=button value= ' 退回 ' onclick= 'history.back() '> </p> ");
手动写的你再调试调试
[解决办法]
for (i = 1; i <= Request.Form( "content1 ").Count; i++) {
sContent1 = sContent1 + Request.Form( "content1 ")(i);
}
Response.Write ( "编辑内容如下: <br> <br> " + sContent1);
Response.Write ( " <br> <br> <p> <input type=button value= ' 退回 ' onclick= 'history.back() '> </p> ");