Click here to Skip to main content
15,920,513 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I made a sudoku game that saves the game to a ".sudoku" file, I want all ".sudoku" files to open with my program and show the icon of my program.

What I have tried:

c# - Associate File Extension with Application - Stack Overflow[^]
Posted
Updated 8-Nov-16 23:27pm
Comments
Mehdi Gholam 9-Nov-16 4:01am    
...and what is the problem?
john1990_1 9-Nov-16 4:08am    
the code doesn't run for me, maybe in:

CurrentUser.DeleteSubKey("UserChoice", false);

I should replace "UserChoice" with something?
Mehdi Gholam 9-Nov-16 4:11am    
Try running as admin.
john1990_1 9-Nov-16 12:03pm    
see below
Richard MacCutchan 9-Nov-16 5:11am    
Since you have the link to the StackOverflow answer, that is the place to ask the question.

1 solution

Well, a solution was provided at the link you cited, so your only recourse at this point is to be an actual programmer, and put an exception around the code, a break point in the catch block, run the app in the debugger, and wait for t to fail. The exception (if thrown) will tell you exactly what's wrong.

You need admin rights to modify the registry, and my spirit animal suggests that you're probably not using an admin account.
 
Share this answer
 
Comments
john1990_1 9-Nov-16 5:36am    
i debugged it, it said:

Access to the registry key 'HKEY_CLASSES_ROOT\.sudoku' is denied.

how do i run it as admin from visual studio?
john1990_1 9-Nov-16 8:21am    
see above

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900