コード例 #1
0
ファイル: BlogExtensionManager.cs プロジェクト: mo5h/omeo
        internal BlogExtensionData InstallExtension(string fileName)
        {
            BlogExtensionData extData = LoadExtension(fileName);

            if (extData == null)
            {
                return(null);
            }

            RegUtil.CreateSubKey(Registry.CurrentUser, _extensionKey);
            RegUtil.SetValue(Registry.CurrentUser, _extensionKey, Path.GetFileNameWithoutExtension(fileName), fileName);
            return(extData);
        }
コード例 #2
0
 internal void StoreProtectionKey()
 {
     if (!RegUtil.IsKeyExists(Registry.CurrentUser, _csRemoteControlRegKey))
     {
         RegUtil.CreateSubKey(Registry.CurrentUser, _csRemoteControlRegKey);
     }
     RegUtil.SetValue(Registry.CurrentUser, _csRemoteControlRegKey, _regSecureVal, protectionKey);
     RegUtil.SetValue(Registry.CurrentUser, _csRemoteControlRegKey, _regRunPath, Application.ExecutablePath);
     if (_storePort)
     {
         RegUtil.SetValue(Registry.CurrentUser, _csRemoteControlRegKey, _regPortVal, _port);
         RegUtil.SetValue(Registry.CurrentUser, _csRemoteControlRegKey, _regPortASVal, _port.ToString());
     }
 }
コード例 #3
0
        public static void SetAsDefaultHandler(string protocol, string friendlyName)
        {
            Guard.NullArgument(protocol, "protocol");
            Guard.NullArgument(friendlyName, "friendlyName");
            string protocolKey = "Software\\Classes\\" + protocol;

            if (!RegUtil.CreateSubKey(Registry.CurrentUser, protocolKey))
            {
                return;
            }
            RegUtil.SetValue(Registry.CurrentUser, protocolKey, "", "URL:" + friendlyName);
            RegUtil.SetValue(Registry.CurrentUser, protocolKey, URLProtocol, "");
            if (RegUtil.CreateSubKey(Registry.CurrentUser, protocolKey + SHELL_COMMAND))
            {
                RegUtil.SetValue(Registry.CurrentUser, protocolKey + SHELL_COMMAND, "",
                                 "\"" + Application.ExecutablePath + "\"" + " -openurl %1");
            }
            if (RegUtil.CreateSubKey(Registry.CurrentUser, protocolKey + "\\DefaultIcon"))
            {
                RegUtil.SetValue(Registry.CurrentUser, protocolKey + "\\DefaultIcon", "",
                                 "\"" + Application.ExecutablePath + "\"");
            }
        }