2

重複の可能性:
C# レジストリ クラスを探して
います レジストリの場所に書き込む方法

いくつかのことを行うことでウィンドウの速度を向上させるプログラムをC#で作成しようとしています(一時フォルダーのクリア、フォルダーのプリフェッチなど)

しかし、プログラムを強力にするために、レジストリ値を編集する必要があります..どうすればそれを行うことができますか?

4

2 に答える 2

2

この記事を読む必要があるかもしれません

public string Read(string KeyName)
{
    // Opening the registry key
    RegistryKey rk = baseRegistryKey ;
    // Open a subKey as read-only
    RegistryKey sk1 = rk.OpenSubKey(subKey);
    // If the RegistrySubKey doesn't exist -> (null)
    if ( sk1 == null )
    {
        return null;
    }
    else
    {
        try 
        {
            // If the RegistryKey exists I get its value
            // or null is returned.
            return (string)sk1.GetValue(KeyName.ToUpper());
        }
        catch (Exception e)
        {
            // AAAAAAAAAAARGH, an error!
            ShowErrorMessage(e, "Reading registry " + KeyName.ToUpper());
            return null;
        }
    }
}
于 2012-07-14T15:45:08.213 に答える
0

Microsoft.Win32.RegistryKeyクラスを使用します。

于 2012-07-14T15:44:22.263 に答える