vb how to write EXE program with execution parameters

Source: Internet
Author: User

About VB how to write EXE program with execution parameters, can be completed by VB with "command ()" commands. Here are CSDN instructions:

Command function

Returns the parameters section of the command line, which is used to mount an executable program developed by Microsoft Visual Basic or Visual Basic.

Grammar

Command

Description

When you load Visual Basic from the command line , /cmd any part of the subsequent command line is passed to the program as a command-line parameter. In the following example, cmdlineargs The parameter information returned by the Command function is represented.

VB /cmd cmdlineargs

For applications developed and compiled with Visual Basic as an. exe file,command returns any parameters that appear after the application name in the command line. For example:

MyApp cmdlineargs
下面是我做的一个简单的实例:
1.新建一个VB工程 工程2;
在窗体上添加一个commandbutton 按钮,代码如下
Private Sub Command1_Click()
    Shell App.Path & "/工程2.exe  safsdf", 1
End Sub
然后保存在某一目录下
2. 在新建一个vb工程 工程2.
代码如下

Private Sub Form_Load ()
Dim CmdLine
CmdLine = Command ()
Me.caption = CmdLine
End Sub

Compile and build the project 2.exe, Project 2.exe Save directory for the front new project catalog.

Then open Project 1, run. The Shell's parameters are displayed in the title bar of Project 2.

How VB writes EXE programs with execution parameters

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.