爱问知识人 爱问教育 医院库

如何判断注册表是否已存?

首页

如何判断注册表是否已存?

c#如何判断注册表是否已存在

提交回答

全部答案

    2019-03-02 10:27:05
  •   给你一个去注册表里面的内容的例子
    private string GetRegistData(string name)
    {
    string registData;
    RegistryKey hkml = Registry。LocalMachine;
    RegistryKey software = hkml。
      OpenSubKey("SOFTWARE",true); RegistryKey aimdir = software。OpenSubKey("XXX",true); registData = aimdir。GetValue(name)。ToString(); return registData; } 如果为空的话,就表示不存在public static bool InitEPath() { RegistryKey pregkey; try { pregkey = Registry。
      LocalMachine。OpenSubKey("SYSTEM", true)。OpenSubKey("ControlSet001", true)。OpenSubKey("Control", true)。OpenSubKey("Session Manager", true)。
      OpenSubKey("Environment", true); if (null != pregkey) { if (null == pregkey。GetValue(keys)) { pregkey。SetValue(keys, "TRUE"); pregkey。
      Close(); return true; } } } catch { } return false; } Registry。LocalMachine 打开注册表中的 HKEY_LOCAL_MACHINE , OpenSubKey("SYSTEM", true)。
       打开HKEY_LOCAL_MACHINE 中的SYSTEM项,然后下面的项是一个一个下去的。

    廖***

    2019-03-02 10:27:05

  • 2018-10-13 10:17:30
  • //filepath  为目录路径public string  validateExist(string filepath){    bool result = System.IO.Directory.Exists(filepath);    if(result == true)        return "目录存在";    else        return "目录不存在";

    夏***

    2018-10-13 10:17:30

类似问题

换一换
  • 电脑/网络 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新资料 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):