C # File Reading (2 ),
Display Folder Information on my computer to the TreeView control. There are many methods. The following method adds my documents.
1 public partial class Form1: Form 2 {3 public Form1 () 4 {5 InitializeComponent (); 6} 7 8 private void Form1_Load (object sender, EventArgs e) 9 {10 BindTreeView1 (); 11} 12 13 private void BindTreeView1 () {14 // Add my computer 15 TreeNode rootNode = new TreeNode ("My Computer "); 16 rootNode. tag = "my computer"; 17 rootNode. text = "my computer"; 18 this. directoryTree. nodes. add (rootNode); 19 20 // my document 21 string myDocuments = Environm Ent. getFolderPath (Environment. specialFolder. myDocuments); 22 TreeNode DocNode = new TreeNode (myDocuments); 23 DocNode. text = "My Documents"; 24 DocNode. tag = "My Documents"; 25 rootNode. nodes. add (DocNode); 26 DocNode. nodes. add (""); 27 28 // cyclically convenient computer so the logic drive 29 foreach (string drive in Environment. getLogicalDrives () 30 {31 DriveInfo dir = new DriveInfo (drive); 32 switch (dir. driveType) 33 {34 case DriveType. fixed: 35 TreeNod E tNode = new TreeNode (dir. name. split (':') [0]); 36 tNode. name = dir. name; 37 tNode. tag = tNode. name; 38 directoryTree. nodes. add (tNode); 39 tNode. nodes. add (""); 40 break; 41} 42} 43 rootNode. expand (); 44} 45 46 private void directoryTree_AfterExpand (object sender, TreeViewEventArgs e) 47 {48 e. node. expand (); 49} 50 51 private void directoryTree_BeforeExpand (object sender, TreeViewCancelEventArgs e) 52 {53 Tr EeViewItems. add (e. node); 54} 55} 56 57 public static class TreeViewItems {58 59 public static void Add (TreeNode e) {60 61 if (e. tag. toString ()! = "My computer") {62 63 e. nodes. clear (); 64 65 TreeNode tNode = e; 66 string path = tNode. name; 67 68 if (e. tag. toString () = "My Documents") 69 {70 path = Environment. getFolderPath (Environment. specialFolder. myDocuments); 71} 72 73 string [] dics = Directory. getDirectories (path); 74 foreach (string dic in dics) 75 {76 TreeNode subNode = new TreeNode (new DirectoryInfo (dic ). name); 77 subNode. name = new DirectoryInfo (dic ). fullName; 78 subNode. tag = subNode. name; 79 tNode. nodes. add (subNode); 80 subNode. nodes. add (""); 81} 82} 83} 84}Show folders
C :\
Yes
Refer to this to clean up the C drive:
1. Disable System Restoration: My computer properties/System Restoration/disable System Restoration on all disks, but I will not be able to use system restoration in the future!
2. Disable System sleep: Control Panel/Power Supply/sleep/remove the check before starting system sleep
3. move the virtual memory, my computer properties/advanced/performance/settings/advanced/change/select the C disk, that is, the system disk, select the no-score page, and then set the virtual memory to its disk, A disk with more disk space remaining, such as D, E, and F. set to 1.5 ~ of memory ~ 2.5 times. The size can be set to the same!
5. Clear temporary IE folders, internet Options, and delete temporary and offline files.
6. delete system logs and program logs, my computer/control panel/management tools/Computer Management/Event Viewer/application, right-click/clear events, and clear system logs in sequence
7. Clear system cache: 2000 all files in the system: C: \ WINNT \ system32 \ dllcache
The XP system is: C: \ windows \ system32 \ dllcache all files under the system cache (open my computer/tool/file and Folder Options/hide the protected system file hook off to hide all files on the hook) ). You can also run the sfc.exe/purgecache command to automatically delete the file.
8. Clear the recycle bin
9. delete the files under c: \ windows \ SoftwareDistribution \ Download (the files downloaded when the system is updated are useless if you have installed the updates)
10. Delete all directories under c: \ windows \ RegisteredPackages
11. Delete all Files under C: \ WINDOWS \ Downloaded Program Files
12. view the hidden files that are known to be protected by the system in my computer folder option, and check all the files.
13. Delete c: \ windows \ All files with $8882305 $ (backup files after system update)
Zhidao.baidu.com/question/11035955.html
Zhidao.baidu.com/question/12223613.html
Zhidao.baidu.com/question/14874715.html
... The remaining full text>
C :\
Yes
Refer to this to clean up the C drive:
1. Disable System Restoration: My computer properties/System Restoration/disable System Restoration on all disks, but I will not be able to use system restoration in the future!
2. Disable System sleep: Control Panel/Power Supply/sleep/remove the check before starting system sleep
3. move the virtual memory, my computer properties/advanced/performance/settings/advanced/change/select the C disk, that is, the system disk, select the no-score page, and then set the virtual memory to its disk, A disk with more disk space remaining, such as D, E, and F. set to 1.5 ~ of memory ~ 2.5 times. The size can be set to the same!
5. Clear temporary IE folders, internet Options, and delete temporary and offline files.
6. delete system logs and program logs, my computer/control panel/management tools/Computer Management/Event Viewer/application, right-click/clear events, and clear system logs in sequence
7. Clear system cache: 2000 all files in the system: C: \ WINNT \ system32 \ dllcache
The XP system is: C: \ windows \ system32 \ dllcache all files under the system cache (open my computer/tool/file and Folder Options/hide the protected system file hook off to hide all files on the hook) ). You can also run the sfc.exe/purgecache command to automatically delete the file.
8. Clear the recycle bin
9. delete the files under c: \ windows \ SoftwareDistribution \ Download (the files downloaded when the system is updated are useless if you have installed the updates)
10. Delete all directories under c: \ windows \ RegisteredPackages
11. Delete all Files under C: \ WINDOWS \ Downloaded Program Files
12. view the hidden files that are known to be protected by the system in my computer folder option, and check all the files.
13. Delete c: \ windows \ All files with $8882305 $ (backup files after system update)
Zhidao.baidu.com/question/11035955.html
Zhidao.baidu.com/question/12223613.html
Zhidao.baidu.com/question/14874715.html
... The remaining full text>