如何在C#中将文件扩展名与我的程序相关联? [英] How to associate file extension with my program in C#?

查看:122
本文介绍了如何在C#中将文件扩展名与我的程序相关联?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个数独游戏,将游戏保存为.sudoku文件,我想用我的程序打开所有.sudoku文件并显示我的程序图标。



我的尝试:



c# - 将文件扩展名与应用程序关联 - 堆栈溢出 [ ^ ]

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[^]

推荐答案

嗯,在链接中提供了一个解决方案引用,所以你在这一点上唯一的办法就是成为一名真正的程序员,并在代码中加一个例外,在catch块中有一个断点,在调试器中运行app,然后等待t失败。异常(如果抛出)将告诉您究竟出了什么问题。



您需要管理员权限来修改注册表,我的精神动物暗示您可能没有使用管理员帐户。
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.


这篇关于如何在C#中将文件扩展名与我的程序相关联?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆