public static GetFriendlySize ( double bytes ) : string | ||
bytes | double | The number of bytes |
return | string |
private void UpdateFileListFromBox() { int tfc = 0; long tfs = 0; foreach (object item in listBox1.Items) { System.IO.FileInfo fd = new System.IO.FileInfo((string)item); tfc += 1; tfs += fd.Length; } if (tfc > 1) { this.radioButton3.Visible = false; this.radioButton4.Visible = false; this.radioButton6.Visible = false; label7.Visible = true; } else { this.radioButton3.Visible = true; this.radioButton4.Visible = true; this.radioButton6.Visible = true; label7.Visible = false; } this.lblCount.Text = Convert.ToString(tfc); this.lblSize.Text = FriendlySizeConverter.GetFriendlySize(tfs); if (this.listBox1.SelectedItems.Count > 0) { this.button3.Enabled = true; } else { this.button3.Enabled = false; } if (tfc == 0) { if (hsa == false) { MessageBox.Show("You have not selected any files. Please select some files and try again.", "Create Archive", MessageBoxButtons.OK, MessageBoxIcon.Error); cos = true; } else { MessageBox.Show("There are currently no files listed to be archived. Please add some files before continuing.", "Create Archive", MessageBoxButtons.OK, MessageBoxIcon.Error); this.wizardPage1.AllowNext = false; } } else { this.wizardPage1.AllowNext = true; } }