How to control folder option with C# or registry
I am developing a C# Application and开发者_高级运维 I need to enable/disable the Hide protected system files option in folder settings via C#. It would also be useful to know what changes are made in the registry when I check or uncheck that check box in the Folder Options dialog.
For current user:
using Microsoft.Win32;
...
const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
int enabled = 1; // 0 to disable
Registry.SetValue(keyName, "ShowSuperHidden", enabled, RegistryValueKind.DWord);
精彩评论