S
Steve
I'm trying to populate a TextBox with system drive information. Using the
following code loops through all of the drives correctly, but only the last
loop's data shows up in the text box.
DriveInfo[] allDrives = DriveInfo.GetDrives();
foreach (DriveInfo d in allDrives)
{
TextBox1.Text = "Drive : " + d.Name + "\r\n";
TextBox1.Text += "File type: " + d.DriveType + "\r\n";
}
Is there some way that I can preserve the data each time? The Textbox is
declared in the deafult.aspx.designer.cs window as
protected global::System.Web.UI.WebControls.TextBox TextBox1;
I know this is simple, but I am just not seeing it.
Thanks,
Steve
following code loops through all of the drives correctly, but only the last
loop's data shows up in the text box.
DriveInfo[] allDrives = DriveInfo.GetDrives();
foreach (DriveInfo d in allDrives)
{
TextBox1.Text = "Drive : " + d.Name + "\r\n";
TextBox1.Text += "File type: " + d.DriveType + "\r\n";
}
Is there some way that I can preserve the data each time? The Textbox is
declared in the deafult.aspx.designer.cs window as
protected global::System.Web.UI.WebControls.TextBox TextBox1;
I know this is simple, but I am just not seeing it.
Thanks,
Steve