public void View(String path) { DxInfo info = new DxInfo(path); switch(info.Extension) { case "JPG": case "JPEG": case "GIF": case "BMP": picviewer.Visible=true; txtviewer.Visible=false; picviewer.Image = Image.FromFile(info.FullPath); break; case "EXE": case "DLL": case "SYS": case "JAR": case "TAR": case "ZIP": case "<nothing>": break; default: picviewer.Visible=false; txtviewer.Visible=true; txtviewer.Text = File.OpenText(info.FullPath).ReadToEnd(); break; } }
public void add(TreeView tree) { String[] dirs = Directory.GetDirectories(path); foreach(string dir in dirs) { String name = new DxInfo(dir).ToString(); tree.SelectedNode.Nodes.Add(new TreeNode(name,1,1)); } }
public void add(ListView list) { String[] dirs = Directory.GetDirectories(path); Array.Sort(dirs); foreach(string dir in dirs) { String name = new DxInfo(dir).ToString(); list.Items.Add(name,1); } }
public void add(ListView list) { String[] files = Directory.GetFiles(path); Array.Sort(files); foreach(string file in files) { String name = new DxInfo(file).ToString(); list.Items.Add(name,2); } }
public void add(TreeView tree) { String[] files = Directory.GetFiles(path); foreach(string file in files) { String name = new DxInfo(file).ToString(); tree.SelectedNode.Nodes.Add(new TreeNode(name,2,2)); } }
public void update(String path) { DxInfo info = new DxInfo(path); FileSystemInfo fs = info.FSInfo; info1.Text = fs.FullName; info2.Text = info.Size ; info3.Text = info.Parent; info4.Text = fs.CreationTime.ToString(); info5.Text = fs.LastAccessTime.ToString(); info6.Text = fs.LastWriteTime.ToString(); info7.Text = fs.Attributes.ToString(); info8.Text = info.Extension; }
private void menuItem11_Click(object sender, System.EventArgs e) { foreach(string s in paths) { DxInfo info = new DxInfo(s); info.copy(selectedPath); } refresh(); }