線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1556
推到 Plurk!
推到 Facebook!

如何傳送連線字串

答題得分者是:supman
xx
一般會員


發表:1
回覆:1
積分:0
註冊:2005-01-14

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-04-06 10:37:12 IP:61.218.xxx.xxx 未訂閱
請問各位,我要傳一個連線字串,可以用idhttp.post嗎?還是要用別的功能 連線字串:"http://fa-moon:8080/Tibco/TibcoSender?fac=ase01&stage=2800&mid=166&opr=SPC&cmd=display_msg&lot=123456&msg=wire pull fail (A14)" source code: procedure TForm1.Button1Click(Sender: TObject); var aa,bb:TStringList; begin aa:=TStringList.create; bb:=TStringList.create; aa.add('fac=ase01'); aa.add('stage=2800'); aa.add('mid=166'); aa.add('opr=SPC'); aa.add('cmd=display_msg'); aa.add('lot=123456'); aa.add('msg=wire pull fail (A14)'); bb:=idhttp1.post('http://fa-moon:8080/Tibco/TibcoSender',aa); if bb.count>0 then showmessage(bb.text); end; 出現: Incompatible types:'TStringList' and 'String' 如果直接送連線字串,不用TstringList會出現: There is no overloaded version of 'Post' that can be called witj these arguments
supman
尊榮會員


發表:29
回覆:770
積分:924
註冊:2002-04-22

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-04-06 13:00:29 IP:61.70.xxx.xxx 未訂閱
您好: 請參考help函數原型 procedure Post(URL: string; const Source: TStrings; const AResponseContent: TStream); overload; procedure Post(URL: string; const Source: TStream; const AResponseContent: TStream); overload; 並不會有傳回值 bb:=idhttp1.post('http://fa-moon:8080/Tibco/TibcoSender',aa); 這一行改成這樣即可 idhttp1.post('http://fa-moon:8080/Tibco/TibcoSender',aa);
xx
一般會員


發表:1
回覆:1
積分:0
註冊:2005-01-14

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-04-06 14:15:18 IP:61.218.xxx.xxx 未訂閱
您好, 有沒有辦法收到傳回值 直接在瀏覽器上key上連線字串,畫面會秀出現在的日期時間Ex:2005-4-6 13:57:4
supman
尊榮會員


發表:29
回覆:770
積分:924
註冊:2002-04-22

發送簡訊給我
#4 引用回覆 回覆 發表時間:2005-04-06 15:07:24 IP:61.70.xxx.xxx 未訂閱
您好: 剛剛我搜尋了一下討論文發現,idHttp.Post是有傳回值的,看下面這篇 http://delphi.ktop.com.tw/topic.php?topic_id=65619 不過怎麼會跟我去翻help寫的不一樣,我就不曉得了. 您將程式改成這樣應該就是您要的結果,試看看 bb.add(idhttp1.post('http://fa-moon:8080/Tibco/TibcoSender',aa));
wameng
版主


發表:31
回覆:1336
積分:1188
註冊:2004-09-16

發送簡訊給我
#5 引用回覆 回覆 發表時間:2005-04-06 15:26:26 IP:61.222.xxx.xxx 未訂閱
純屬插個花! procedure Post(URL: string; const Source: TStrings; const ResponseContent:TStream); overload; procedure Post(URL: string; const Source, AResponseContent: TStream); verload; AResponseContent就是回傳值。 看Indy 附的範例就很清楚。 參考參考
系統時間:2024-06-30 2:59:30
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!