- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我一直在尝试找到一种方法来更改默认文件关联Windows 7 中的特定文件扩展名。我有一个用于查看 .tif 的应用程序如果它不是该文件的默认查看器,我想提示用户的文件类型。如果他们选择将其设为默认值,我想覆盖当前的默认查看器。如果没有安装其他查看器,这将正常工作系统。当用户选择了另一个查看器时,我无法在此处更改控制它的注册表项:
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\UserChoice
I have scoured the web trying to find someone that has done this, but nobodyseems to have any answers. When I try to update the "Progid" value within thiskey, I get a "Cannot write to the registry key" or "Requested registry access isnot allowed" errors. The code is simple enough:
var path = @"Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\UserChoice";
var key = Registry.CurrentUser.OpenSubKey(path, true);
key.SetValue("Progid", "myprogid...");
这个 key 是否有一些特殊的保护来防止它被以编程方式编辑?
最佳答案
为了能够写入 key UserChoice,您需要在写入之前获取该 key 的所有权(如 this 代码 - 不是在 c# (C++) 中,但我认为它可以以相同的方式完成)。
您将能够写入 key ,并且您的文件关联代码将起作用!
关于c# - 有没有办法以编程方式设置 "UserChoice"注册表项以接管文件类型关联?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6191096/
我一直在尝试找到一种方法来更改默认文件关联Windows 7 中的特定文件扩展名。我有一个用于查看 .tif 的应用程序如果它不是该文件的默认查看器,我想提示用户的文件类型。如果他们选择将其设为默认值
Qt 文档说我可以获得一个弹出窗口供用户选择 QNetworkConfiguration。但是我该怎么做呢? 当我有 QNetworkConfiguration config; QNetworkSes
我正在研究文件关联。我已经确定在以下位置有一个名为 UserChoice 的键: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion
当我执行 playGame();我想展示这个:您已选择 ${userChoice),计算机已选择 ${computerChoice}。获胜者是 ${determineWinner}。根据我的理解,us
在 Windows 8 中,用户对给定文档类型打开哪个应用程序的选择似乎保留在 HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
我是一名优秀的程序员,十分优秀!