在 C# 中执行我的文件的应用程序
我的应用程序创建带有“.mhm”扩展名的文件。
我希望我的应用程序在双击这些文件时打开并处理它们。当前的行为是,当我双击该文件时,我的应用程序会打开但不会处理该文件。
如何读取 C# 2008 中 Main() 方法的 args 参数?
My application creates files with a ".mhm" extension.
I'd like for my application to open and process these files when I double-click them. Current behavior is that when I double-click the file, my application opens but does not process the file.
How can I read the args parameter of Main() method in C# 2008?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“嗨,
我的应用程序创建带有 .MHM 文件扩展名的文件。
我希望我的应用程序与此文件扩展名相关联,这样当执行 MHM 文件时,我的应用程序也是如此,文件路径作为我的应用程序主要方法的参数。”
这就是我的理解。Grzenio
有正确的想法 -
但将您的应用程序推送到 shell 中需要额外的研究,您必须考虑将您的应用程序集成到 Shell 中(使用注册表)
。 /questions/212906/script-to-associate-an-extension-to-a-program#212921">脚本将-extension-to-program关联
编辑: 感谢克里斯对问题的编辑,试图在这里看到更广泛的东西......也许参数解决方案就是 OP 所需的全部。
"Hi
My Application creates files with the .MHM file extension.
I would like my application to be associated with this file extension so that when a MHM file is executed, my application is too, with the file path as the arguments for the main method of my application."
That's what I understood.
Grzenio has the right idea -
but to push your application into the shell would take extra research, you'd have to look into integrating your application into the Shell (using the registry).
See here: script-to-associate-an-extension-to-a-program
EDIT: Thanks for the edit of the question Chris, trying to see things a bit wider here... Perhaps the arguments solution was all the OP needed.
如果我正确理解你的问题,你只需使用:
If I understand your question correctly you just use: