如何从c#中的注册表中读取十六进制值 [英] how to read hex value from registry in c#

查看:195
本文介绍了如何从c#中的注册表中读取十六进制值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c#中读取注册表中的十六进制值????

i使用blelo代码读取字符串中的值,但我想从注册表中读取十六进制值。



how to read hex value from registry in c#????
i use blelo code to read value in string but i wan to read hex value from the registry.

String s= (String)Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\ImgBurn\\Phone", "EVENTS_CheckForProgramUpdate", null)

推荐答案

您可以查看以下链接以获取更多信息。



You can check below link for more info.

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;
        }
    }
}





欲了解更多信息: < br $> b $ b

使用C#从注册表中读取,写入和删除[ ^ ]



我希望这会对你有所帮助。



For more info:

Read, write and delete from registry with C#[^]

I hope this will help to you.


这篇关于如何从c#中的注册表中读取十六进制值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆