mirror of
				https://github.com/snltty/linker.git
				synced 2025-11-01 04:53:15 +08:00 
			
		
		
		
	优化一些东西
This commit is contained in:
		| @@ -25,7 +25,7 @@ namespace cmonitor.server.client.reports.system | ||||
|             drives = WindowsDrive.GetAllDrives(); | ||||
|             registryKeys = registryOptionHelper.GetKeys(); | ||||
|             ReportTask(); | ||||
|             RegistryOptions(new RegistryUpdateInfo { Name = "SoftwareSASGeneration", Value = true }); | ||||
|             RegistryOptions(new RegistryUpdateInfo { Name = "SoftwareSASGeneration", Value = false }); | ||||
|         } | ||||
|  | ||||
|  | ||||
| @@ -62,9 +62,13 @@ namespace cmonitor.server.client.reports.system | ||||
|         int registryUpdated = 0; | ||||
|         int registryUpdateFlag = 1; | ||||
|         public bool RegistryOptions(RegistryUpdateInfo registryUpdateInfo) | ||||
|         { | ||||
|             bool result = registryOptionHelper.UpdateValue(registryUpdateInfo.Name, registryUpdateInfo.Value); | ||||
|             if (result) | ||||
|             { | ||||
|                 Interlocked.Exchange(ref registryUpdated, 1); | ||||
|             return registryOptionHelper.UpdateValue(registryUpdateInfo.Name, registryUpdateInfo.Value); | ||||
|             } | ||||
|             return result; | ||||
|         } | ||||
|         private void RegistryForce() | ||||
|         { | ||||
| @@ -191,10 +195,14 @@ namespace cmonitor.server.client.reports.system | ||||
|                     { | ||||
|                         continue; | ||||
|                     } | ||||
|                     Registry.SetValue(path, pathItem.Key, int.Parse(value ? pathItem.DisallowValue : pathItem.AllowValue), RegistryValueKind.DWord); | ||||
|                 } | ||||
|                     string setValue = value ? pathItem.DisallowValue : pathItem.AllowValue; | ||||
|                     if(Registry.GetValue(path, pathItem.Key, pathItem.AllowValue).ToString()  != setValue) | ||||
|                     { | ||||
|                         Registry.SetValue(path, pathItem.Key, int.Parse(setValue), RegistryValueKind.DWord); | ||||
|                         return true; | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|             return false; | ||||
|         } | ||||
|         private string ReplaceRegistryPath(string path) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 snltty
					snltty