私有注册表基于docker 1.10.3运行良好,但在docker更新到1.12.0后我无法拉/推图像.
我修改了/ etc/sysconfig/docker:
OPTIONS='--selinux-enabled=true --insecure-registry=myip:5000'
Run Code Online (Sandbox Code Playgroud)
要么
OPTIONS='--selinux-enabled=true --insecure-registry myip:5000'
Run Code Online (Sandbox Code Playgroud)
但是当我执行pull/push时,我收到了这个错误:
$ docker pull myip:5000/cadvisor
Using default tag: latest
Error response from daemon: Get https://myip:5000/v1/_ping: http: server gave HTTP response to HTTPS client
Run Code Online (Sandbox Code Playgroud)
当我将docker更改为1.10.3时,它仍然可以正常工作如下:
$ docker pull myip:5000/cadvisor
Using default tag: latest
Trying to pull repository myip:5000/cadvisor ...
latest: Pulling from myip:5000/cadvisor
09d0220f4043: Pull complete
a3ed95caeb02: Pull complete
151807d34af9: Pull complete
14cd28dce332: Pull complete
Digest:
sha256:33b6475cd5b7646b3748097af1224de3eee3ba7cf5105524d95c0cf135f59b47
Status: Downloaded newer image for myip/cadvisor:latest
Run Code Online (Sandbox Code Playgroud)
下面列出了一些相关信息:
docker version
Client:
Version: 1.12.0
API version: …Run Code Online (Sandbox Code Playgroud) 如何检查C#代码是否存在注册表值?这是我的代码,我想检查"开始"是否存在.
public static bool checkMachineType()
{
RegistryKey winLogonKey = Registry.LocalMachine.OpenSubKey(@"System\CurrentControlSet\services\pcmcia", true);
string currentKey= winLogonKey.GetValue("Start").ToString();
if (currentKey == "0")
return (false);
return (true);
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试获取此键中子键的所有显示名称:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
Run Code Online (Sandbox Code Playgroud)
使用此代码:
RegistryKey newKey;
string val;
string KeyPath64Bit = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
RegistryKey mainKey = Registry.LocalMachine.OpenSubKey(KeyPath64Bit);
string[] RegKeys64Bits = Registry.LocalMachine.OpenSubKey(KeyPath64Bit).GetSubKeyNames();
foreach (string s in RegKeys64Bits)
{
newKey = mainKey.OpenSubKey(s);
val = newKey.GetValue("DisplayName", -1, RegistryValueOptions.None).ToString();
if (val != "-1")
file64.WriteLine(val);
}
Run Code Online (Sandbox Code Playgroud)
运行代码后,我找不到我需要的密钥之一:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DA5E371C-6333-3D8A-93A4-6FD5B20BCC6E}
Run Code Online (Sandbox Code Playgroud)
它应该有显示名称:Microsoft Visual C++ 2010 x64 Redistributable - 10.0.30319,但该GetSubKeyNames()方法给了我子键:{DA5E371C-6333-3D8A-93A4-6FD5B20BCC6E}.KB2151757它没有任何显示名称.
为什么我不能得到我需要的确切子键({DA5E371C-6333-3D8A-93A4-6FD5B20BCC6E}),我怎么能得到它?
我创建了一个在启动期间启动的应用程序,下面的代码如下.
重启后,该进程在进程管理器工具上运行,但我无法在屏幕上看到该应用程序.当我从启动注册表值打开相同的.exe文件时,程序运行完美.
// The path to the key where Windows looks for startup applications
RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
// Add the value in the registry so that the application runs at startup
rkApp.SetValue("MyApp", Application.ExecutablePath.ToString());
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能解决这个问题?
我需要开发一个过程来检测用户计算机是否安装了某些程序,如果安装了,那么是什么版本.我相信我需要一个包含注册表位置和密钥的列表来查找并将其提供给程序,这不是问题.有没有更好的方法来实现这一目标?
我的第一个想法是在卸载条目中检查注册表,但似乎我想要检测的其中一个应用程序没有.使用应用程序进行输入的所有注册表的标准位置是什么?
如何在Windows上更改Java运行时版本.
我安装了Java 7进行一些测试,现在我需要旧的java6作为系统默认值,但我不想卸载Java 7(我需要它用于以后的测试).我可以在控制面板/ Java/JRE选项卡中更改系统使用的JRE吗?我可以更改/编辑/添加/删除用户使用的版本,但不能更改系统使用的版本.
我需要使用REG QUERY命令来查看键的值,并使用以下命令将结果设置为变量:
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "KeyName" /v ValueName') DO SET Variable=%%B
Run Code Online (Sandbox Code Playgroud)
但是如果密钥不存在,我会在控制台中显示错误.我需要隐藏这个错误!我尝试在命令之后输入2> nul来停止stderr,但是如果我只调用命令,这会有效:
REG QUERY "KeyName" /v ValueName 2>nul
Run Code Online (Sandbox Code Playgroud)
如果我将它放入FOR命令中,如下所示:
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "KeyName" /v ValueName') DO SET Variable=%%B 2>nul
Run Code Online (Sandbox Code Playgroud)
显示错误.那么有谁知道如何隐藏错误?或者也许另一个命令也看是否存在密钥?
谢谢
PS:我正在使用Windows XP
我编写了一个编辑特定文件类型的程序,我想让用户选择在启动时将我的应用程序设置为此文件类型的默认编辑器(因为我不需要安装程序).
我已经尝试编写一个可重用的方法,通过向HKEY_CLASSES_ROOT添加密钥,并将其与我的应用程序一起使用,但是它不会为我关联文件(最好是在任何操作系统上,虽然我正在运行Vista)似乎工作.
public static void SetAssociation(string Extension, string KeyName, string OpenWith, string FileDescription)
{
RegistryKey BaseKey;
RegistryKey OpenMethod;
RegistryKey Shell;
RegistryKey CurrentUser;
BaseKey = Registry.ClassesRoot.CreateSubKey(Extension);
BaseKey.SetValue("", KeyName);
OpenMethod = Registry.ClassesRoot.CreateSubKey(KeyName);
OpenMethod.SetValue("", FileDescription);
OpenMethod.CreateSubKey("DefaultIcon").SetValue("", "\"" + OpenWith + "\",0");
Shell = OpenMethod.CreateSubKey("Shell");
Shell.CreateSubKey("edit").CreateSubKey("command").SetValue("", "\"" + OpenWith + "\"" + " \"%1\"");
Shell.CreateSubKey("open").CreateSubKey("command").SetValue("", "\"" + OpenWith + "\"" + " \"%1\"");
BaseKey.Close();
OpenMethod.Close();
Shell.Close();
CurrentUser = Registry.CurrentUser.CreateSubKey(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\" + Extension);
CurrentUser = CurrentUser.OpenSubKey("UserChoice", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl);
CurrentUser.SetValue("Progid", KeyName, RegistryValueKind.String);
CurrentUser.Close();
}
Run Code Online (Sandbox Code Playgroud)
知道为什么它不起作用吗?一个示例用途可能是
SetAssociation(".ucs", "UCS_Editor_File", …Run Code Online (Sandbox Code Playgroud) 我开发了一个应用程序并将其安装在客户端计算机上.在我的应用程序中,我需要获取其安装路径.我的应用程序有一个注册表项:
HKEY_LOCAL_MACHINE\SOFTWARE\MyApplication\[AppPath]
Run Code Online (Sandbox Code Playgroud)
如何AppPath使用C#阅读?
既然Office也是64位安装,在注册表中你会发现安装的Office版本是32位还是64位?
registry ×10
c# ×5
windows ×2
32bit-64bit ×1
batch-file ×1
controls ×1
docker ×1
java ×1
ms-office ×1
office-2010 ×1
panel ×1
startup ×1