Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

What registry keys are responsible for file extension association?

$
0
0
I'm trying to associate file extension to start some type of files with my application. Which registry keys I have to modify to be sure, that when user double click at file it opens with my application.
And how get delete/modify permisions to key "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\<extension>\UserChoice"?
This key created after setting default program by "Open with" dialog.

I've tried:
string ext=".eee";

RegistryKey r = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\"+ext);

RegistryPermission f = new
RegistryPermission(RegistryPermissionAccess.Write, r.Name);
f.Assert();
r.OpenSubKey("UserChoice", true); //at this step "Requested registry access is not allowed." exception occured

Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>