表格和命令行 [英] Forms and Command Line

查看:81
本文介绍了表格和命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以以Windows形式编写命令行(cmd)?

Is it possible to write the command line (cmd) in Windows form? 

例如,我有一个Windows窗体,然后我想在启动窗体或单击按钮事件时执行以下命令. (要映射驱动器号为T的共享文件夹),可以吗?

For example, I have a Windows form and then I would like to execute following command either at Form launch or Button click event. (to map shared folder with drive letter T), is that possible?

净使用T:\\ PC \ TestTempShare

Net Use T:  \\PC\TestTempShare

我检查了process.start和command.Equals,但是都没有用.

I checked with process.start and command.Equals but both didn't worked.

N.A.Malik

N.A.Malik

推荐答案

您不需要使用命令行来映射网络驱动器资源.只需使用Windows API函数调用即可:

You don't need to use the command line to map a network drive resource. Just use the Windows API function calls:


这篇关于表格和命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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