我测试了一下,Edit1.Text:=ParamStr(1);  Edit1中怎么是空的呢,ParamStr(1)表示的是什么呀,用ParamStr(0)的到的是全路径加执行文件

解决方案 »

  1.   

    Returns a specified parameter from the command-line.UnitSystemCategorycommand line utilitiesfunction ParamStr(Index: Integer): string;DescriptionParamStr returns the parameter from the command line that corresponds to Index, or an empty string if Index is greater than ParamCount. For example, an Index value of 2 returns the second command-line parameter.ParamStr(0) returns the path and file name of the executing program (for example, C:\TEST\MYPROG.EXE).Note: Use double quotes to wrap multiple words as one parameter (such as long file names containing spaces).
      

  2.   

    命令行第一个参数如执行c:\xxx\xxx.exe -testParamStr(1)得到'-test',后面依此类推