|
实战Registry和RegistryKey类,一个简单的可疑文件扫描程序(1)
private void Search() { try { this.listBox1.Items.Add(""); this.listBox1.Items.Add("扫描指定的目录文件"); RegistryKey scan = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Honeydogchen\\.Dog\\Scan",true); string strdir = scan.GetValue("FolderSelect").ToString(); if(this.checkBox2.Checked==true) { RegistryKey microsoft = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft",true); RegistryKey currentversion1 = microsoft.OpenSubKey("Windows NT\\CurrentVersion",true); RegistryKey currentversion2 = microsoft.OpenSubKey("Windows\\CurrentVersion",true); try { string system32dir = currentversion1.GetValue("SystemRoot").ToString(); GetSystemFiles(system32dir+"\\SYSTEM32"); } catch(Exception) { } try { string systemdir = currentversion2.GetValue("SystemRoot").ToString(); GetSystemFiles(systemdir+"\\SYSTEM"); } catch(Exception) { }
|