如何将参数传递给命令提示符&在mfc中运行? [英] How to pass parameters to the command prompt & run in mfc?

查看:94
本文介绍了如何将参数传递给命令提示符&在mfc中运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在mfc中将参数传递给命令提示符?

how to pass parameters to command prompt in mfc?

推荐答案

(不确定我找到了你)你可以使用system [ ^ ]功能(或 ShellExecute [ ^ ]或 CreateProcess [ ^ ])。
(Not sure I got you) You may use the system[^] function (or ShellExecute[^] or CreateProcess[^]).


我认为他想使用命令行参数启动Windows应用程序。在这种情况下,他可以尝试这个



I think he wants to start a Windows application using command line arguments. In that case he could try this

Dim arg As String()
        arg = Environment.GetCommandLineArgs()
        For i As Integer = 1 To arg.Length - 1
            Select Case arg(i).ToLower
                Case "a"
                    'Insert code here
                Case "b"
                    'Insert code here
                Case "c"
                    'Insert code here
                Case Else
                    MessageBox.Show("Unknown argument " & arg(i) & ". Programm starts without arguments", "Oops")                    
            End Select
        Next


这篇关于如何将参数传递给命令提示符&在mfc中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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