从资源管理器中打开我的vb程序 [英] open my vb program from explorer

查看:107
本文介绍了从资源管理器中打开我的vb程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从Windows资源管理器中点击时,我设置了一个文件扩展名来打开我的vb程序。

如何让我的程序识别并加载文件?

Tom ..

解决方案

假设您已正确设置与程序的exe关联的唯一文件扩展名,以下段落将帮助您确定如何检索文件名在你的程序中。您的程序应该在 Release 模式下编译,您的程序应该在相同的目录结构中,并且具有相同的名称作为完整路径名称您在设置唯一扩展程序和程序之间的关联时使用。



您的程序可以使用 Environment.CommandLine检索其命令行值

Environment.CommandLine 中检索命令行后,解析命令行以获取文件名。



1.命令行中的第一个值是程序的完整路径名。

2.命令行中的第二个值是在资源管理器中双击的文件的名称。


感谢Mike ....这正是我需要的......

再次感谢。 .tom

I have set a file extension to open my vb program when I click from Windows Explorer.
How do I get my Program to recognize and load the file?
Tom..

解决方案

Assuming that you have properly setup your unique file extension to be associated with your program's exe, the following paragraph will help you determine how to retrieve the filename in your program. Your program should be compiled in Release mode and your program should be in the same directory structure and have the same name as the full path name that you used when you setup the association between your unique extension and your program.

Your program can retrieve its commandline value using Environment.CommandLine.
After retrieving the commandline from Environment.CommandLine, parse the commandline to get the filename.

1. The first value in the commandline is the full path name of your program.
2. The second value in the commandline is the name of the file that you double-clicked on in Explorer.


Thanks Mike.... That is exactly what i needed..
Thanks again ..tom


这篇关于从资源管理器中打开我的vb程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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