private void Form1_Load_1(object sender, EventArgs e) { FIleMemo ext = new FIleMemo(); EXT = new List <string>(); ext.FileRead(); stereo = ext.STEREO(); text = ext.TEXT(); media = ext.MEDIA(); image = ext.IMAGE(); other = ext.OTHER(); LastDay = "7"; Path = "C:\\Users\\fc\\Desktop\\"; label1.Text = Path; }
private void Form2_Load(object sender, EventArgs e) { FIleMemo ext = new FIleMemo(); ext.FileRead(); stereo = ext.STEREO(); text = ext.TEXT(); media = ext.MEDIA(); image = ext.IMAGE(); other = ext.OTHER(); try { if (stereo.Count() != 0) { for (int i = 0; i < stereo.Count(); i++) { listBox1.Items.Add(stereo[i]); } } if (text.Count() != 0) { for (int i = 0; i < text.Count(); i++) { listBox2.Items.Add(text[i]); } } if (media.Count() != 0) { for (int i = 0; i < media.Count(); i++) { listBox3.Items.Add(media[i]); } } if (image.Count() != 0) { for (int i = 0; i < image.Count(); i++) { listBox4.Items.Add(image[i]); } } if (other.Count() != 0) { for (int i = 0; i < other.Count(); i++) { listBox5.Items.Add(other[i]); } } } catch (ArgumentNullException) { } //현재 로컬 컴퓨터에 존재하는 드라이브 정보 검색하여 트리노드에 추가 DriveInfo[] allDrives = DriveInfo.GetDrives(); foreach (DriveInfo dname in allDrives) { if (dname.DriveType == DriveType.Fixed) { if (dname.Name == @"C:\") { TreeNode rootNode = new TreeNode(dname.Name); rootNode.ImageIndex = 0; rootNode.SelectedImageIndex = 0; treeView1.Nodes.Add(rootNode); Fill(rootNode); } else { TreeNode rootNode = new TreeNode(dname.Name); rootNode.ImageIndex = 1; rootNode.SelectedImageIndex = 1; treeView1.Nodes.Add(rootNode); Fill(rootNode); } } } //첫번째 노드 확장 treeView1.Nodes[0].Expand(); }