如何实现应用程序传参数,即 abc.exe param1,param2(100分)

  • 主题发起人 iwantflywithwin
  • 开始时间
I

iwantflywithwin

Unregistered / Unconfirmed
GUEST, unregistred user!
如何实现应用程序传参数,即 abc.exe param1,param2(应用程序 参数列表),如果用c++的话
就是main(string arg[])里面的参数了。
 
-------------------------------------------------------
abc.exe beep exit
-------------------------------------------------------
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
for i := 1 to ParamCount do
begin
if LowerCase(ParamStr(i)) = 'beep' then
Beep
elseif LowerCase(ParamStr(i)) = 'exit' then
Application.Terminate;
end;
end;
 
可以通过Application.param..()函数获得,(0)是当前程序的路径+程序名
 
desertsmoke:我说的是如何把参数传入应用程序,又如和调用它。
zbsfg:Application好像没有param属性啊??能不能说的详细些?
 
我说的也是这个意思
 
desertsmoke:谢谢,我试过了,成功了。
你的回答很迅速,送上100分,不成敬意,谢谢!
 
顶部