필요 테스트,키 설정 키를 취소하고 모든 경우의 전체 경로 및 키 값지 않을 수도 있습은 실제로 존재합니다. 내가 생각하는 명령은 다음과 같습니다 계정에 의해 false 를 반환하는 경우의 일부 경로에 존재하지 않을 확인하고 만들의 경로를 설정하는 경우 그것은 존재하지 않았다,그러나지 않을 것 같다습니다.
internal bool DownloadGroupByOff()
{
using (RegistryKey hku = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
{
using (RegistryKey explore = hku.OpenSubKey(@"Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{885A186E-A440-4ADA-812B-DB871B942259}"))
{
if (GetValueInt(explore,"GroupView") == 0)
return true;
}
}
return false;
}
public void DownloadGroupByEnable()
{
using (RegistryKey hku = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
{
using (RegistryKey explore = hku.OpenSubKey(@"Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{885A186E-A440-4ADA-812B-DB871B942259}", true))
{
explore.DeleteValue("GroupView");
explore.DeleteValue("Mode");
}
}
}
public void DownloadGroupByDisable()
{
using (RegistryKey hku = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
{
using (RegistryKey explore = hku.OpenSubKey(@"Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{885A186E-A440-4ADA-812B-DB871B942259}", true))
{
explore.SetValue("", "Downloads");
explore.SetValue("GroupView", "0");
explore.SetValue("Mode", "4");
}
}
}
그래서 무엇을 알고 싶은 가장 깨끗한을 처리하는 방법이 이 문제를 해결합니다. 내가 쓸 수 있는 빠른 함수를 나누기까지 경로,테스트,각 수준과 추가 키 없는 경우에는 이미지만,오히려하지 않는 경우가 더 많은 우아한 또는 내장된 방법이다.