如何获取被单击以启动程序的文件的名称 [英] How to get the name of the file which was clicked to start the program

查看:78
本文介绍了如何获取被单击以启动程序的文件的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序是通过单击具有特定扩展名的文件启动的,但是我找不到打开该文件的名称.显然,CommandLineArgs不能单击一次应用程序.有什么想法(我正在使用VB 2010 Express)

My program is launched by clicking a file with a particular extension but I can''t find the name of the file to open it. Apparently the CommandLineArgs are not available to click once applications. Any ideas please (I am using VB 2010 express)

推荐答案

使用
IO.Path.GetFileName(Application.ExecutablePath)


请参见 Application.ExecutablePath属性 [Path.GetFileName方法 [


See Application.ExecutablePath Property[^] and Path.GetFileName Method[^] for explanation.


获取C#中已注册的文件类型及其关联的图标 [
Get Registered File Types and Their Associated Icons in C#[^] should help you get information about the program you want to launch.


这篇关于如何获取被单击以启动程序的文件的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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