如何通过单击文件来调用我的progrom? [英] How do I call my progrom by click a file?

查看:104
本文介绍了如何通过单击文件来调用我的progrom?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在制作视频播放器。现在我可以播放视频。但我希望当我点击一个视频文件时,它可以在我的播放器中播放。我该怎么办?我想我需要改变注册。我想知道如何更改它以及如何通过C#代码更改它。

谢谢。

Hi,
I am making a video player. Now I can play a video. But I would like that when I click a video file, it can be played in my player. What should I do? I guess I need to change register. I'd like to know how to change it and how to change it by C# code.
Thank you.

推荐答案

你需要一个文件关联在您的应用程序和视频的文件类型之间。参见例如 http://stackoverflow.com/questions/1556853/associating-file-extensions-with- a-program [ ^ ]或 VB.NET中的文件关联 [ ^ ]
You need a file association between your application and the file type of the videos. See e.g. http://stackoverflow.com/questions/1556853/associating-file-extensions-with-a-program[^] or File Association in VB.NET[^]


首先,您需要扩展名的文件关联。

关联文件后,WIndows将调用您的程序EXE并将文件名作为命令行参数发送,您需要读取参数并播放该文件。
First you need File Association for the Extension.
After you associate the file, WIndows will call your program EXE and send the file name as a command line argument, You need to read the argument, and play the file.


您必须扩展/自定义shell上下文菜单。



这是一个很好的起点:在你的应用程序中使用Shell ContextMenu [ ^ ]
You have to extend/customize the shell context menu.

Here is a good starting point: Use Shell ContextMenu in your applications[^]


这篇关于如何通过单击文件来调用我的progrom?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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