如何在命令提示字元取得輸入之參數 |
答題得分者是:jow
|
ahentseng
一般會員 發表:6 回覆:9 積分:13 註冊:2008-03-19 發送簡訊給我 |
|
jow
尊榮會員 發表:66 回覆:751 積分:1253 註冊:2002-03-13 發送簡訊給我 |
這是delphi help裡的example
[code delphi] procedure TForm1.FormCreate(Sender: TObject); var i: Integer; for i := 1 to ParamCount do begin if LowerCase(ParamStr(i)) = 'beep' then Beep else if LowerCase(ParamStr(i)) = 'exit' then Application.Terminate; end; end; [/code] 另外,在Design Time時, 你可以在下列位置輸入你的參數 Run->Parameters->Parameters (Edit) |
ahentseng
一般會員 發表:6 回覆:9 積分:13 註冊:2008-03-19 發送簡訊給我 |
不好意思喔...jow大大...我研究一下..看不懂意思...晚一點結案
===================引 用 jow 文 章=================== [code delphi] procedure TForm1.FormCreate(Sender: TObject); var i: Integer; for i := 1 to ParamCount do begin if LowerCase(ParamStr(i)) = 'beep' then Beep else if LowerCase(ParamStr(i)) = 'exit' then Application.Terminate; end; end; [/code] |
ahentseng
一般會員 發表:6 回覆:9 積分:13 註冊:2008-03-19 發送簡訊給我 |
|
jow
尊榮會員 發表:66 回覆:751 積分:1253 註冊:2002-03-13 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |