用Windows应用程序附加cmd [英] attaching cmd with windows app

查看:66
本文介绍了用Windows应用程序附加cmd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,我想用winforms应用程序附加cmd。是否可能?

如果可能的话,怎么做?

Dear sir, I wanna attach cmd with winforms application. Is it possible?
If possible, then how?

推荐答案

如果你的意思是想要为WinForms应用程序提供命令行参数,那么是的,你可以。

你需要做的就是:

If you mean you want to supply command line parameters to a WinForms app, then yes, you can.
All you need to do is:
string[] args = Environment.GetCommandLineArgs();

在您的表单代码中,您将获得它们。

当您将app注册为处理文件扩展名时,然后在Windows资源管理器中双击将通过这些参数将文件路径传递到您的应用程序,例如 - 或者您可以将它们添加到桌面上的快捷方式。



如果这不是您想要的,那么您需要指定相当更好的完成您想要做的事情,记住我们无法看到您的屏幕,访问您的硬盘或阅读您的想法。

in you form code, and you will be given them.
When you register you app as handling a file extension, then a double click in Windows Explorer will pass the file path to your app via these arguments, for example - or you can add them to a shortcut on your desktop.

If that isn't what you want, then you need to specify rather better exactlky what you are trying to do, bearing in mind that we can't see your screen, access your HDD, or read your mind.


这篇关于用Windows应用程序附加cmd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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