写了个模拟PING 的程序 不知道如何实现逐行显示的效果 for (int i = 0; i < 30; i++)
{
if (reply.Status == IPStatus.Success)
{
result += i + "<br />\r\n";
}
else
{
result += "超时<br />\r\n";
}
} lblMsg.Text = "ping " + ip.Text + "(" + trueip + ")" + "结果:<br />" + result.ToString();
{
if (reply.Status == IPStatus.Success)
{
result += i + "<br />\r\n";
}
else
{
result += "超时<br />\r\n";
}
} lblMsg.Text = "ping " + ip.Text + "(" + trueip + ")" + "结果:<br />" + result.ToString();
如果是HTML的话,把数据写给HTML中的javascript,等接收完毕后,用Javascript分成行,setTimeOut或者另外一个函数忘了叫啥了,控制逐行显示。最好还是有中间的对象可以使用,Json,xml什么的。
Response.Write("<script type='text/javascript'>");//这个是正斜杠还是反斜杠忘掉了 你检查下
Response.Write(string.Format("var stringData = {0}",result));
Response.Write("</script>");
然后在一个你想要逐行显示的地方,处理它。