如何将所有选定的文件名传递给C#应用程序? [英] How to pass all selected files names to C# application ?

查看:88
本文介绍了如何将所有选定的文件名传递给C#应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想选择桌面(或其他任何文件夹)上的几个文件,并将它们的名称传递给我的应用程序.

更具体地说,我在注册表中添加了一个密钥,这样,当我右键单击jpeg文件时,我会看到一个新的转换"选项,该选项实际上在运行我的应用程序.问题是如何将所有选定的文件名传递给应用程序?

非常感谢!

Hi,

I would like to select several files on my desktop (or any other folder) and pass their names to my application.

More specifically, I''ve added a key to the registry such that when I right click on a jpeg file I see a new "Transform" option that actually runs my application. The question is how can I pass all selected files names to my application ?

Thanks a lot !

推荐答案

不是吗?你做了什么测试?我希望设置完成后,您的应用将为每个选定的文件启动一次,并传递该文件名.
Doesn''t it just happen ? what testing have you done ? I''d expect that once you have this set up, your app will be started once for each selected file, and passed that filename.


对于Windows Forms应用程序,请使用
For Windows Forms applications, use Environment.GetCommandLineArgs().


实际上,我不知道如何在我的应用程序中获取文件名.
我在Visual Studio中启动了一个新的Windows窗体应用程序项目,并且自动生成的Main()函数没有"args"参数.为什么?
Actually, I don''t know how to get the filenames in my app.
I started a new Windows Form Application project in Visual Studio, and the automatically generated Main() function does not have the "args" parameter. Why ?


这篇关于如何将所有选定的文件名传递给C#应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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