我想知道局域网有哪些机子开着,写了如下代码,用了多线程扫描,我想让扫描的结果一个一个陆续显示,而不是全部扫描完后一下子突然显示出来,不知下面的代码哪里写的有问题,望各位高手指教!!public class ceshiinte : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.TextBox TextBox1;

public int i=1;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
} #region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{    
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load); }
#endregion public void ma()
{

Process p = new Process();       
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardInput.WriteLine("ping -w 100 -n 1 211.70.233."+i.ToString());
p.StandardInput.WriteLine("exit");
string strRst = p.StandardOutput.ReadToEnd();
string text;
if(strRst.IndexOf("Received = 0")==-1)
{
text=i.ToString()+"号机连接正常";
}
else
{
text=i.ToString()+"号机连接失败";
}
this.TextBox1.Text+=text+"\n";
i++;

} private void Button1_Click(object sender, System.EventArgs e)
{
for(int i=1;i<5;i++)
{
Thread t=new Thread(new ThreadStart(ma));
t.Start();
t.Join();
}
}
}