請問一下關於 idftp 的proxy 問題 |
尚未結案
|
蜻蜓草
一般會員 發表:22 回覆:30 積分:10 註冊:2002-03-18 發送簡訊給我 |
請問一下關於 idftp 的proxy 問題
我想用 isp 提供的 proxy 下載 ftp 中的檔案, 如果不加 proxy 的那些設定是正常無誤的, 加上以後卻出現 , " connection close gracefully" 不知是那錯了??
用的是 delphi 6, 請各位前輩指點一下 , 謝謝~~ procedure TForm1.BitBtn1Click(Sender: TObject);
var i:longint;aADest: TMemoryStream ; aAResume:boolean;
begin aadest:=TMemoryStream .Create;
tFTP.Host := 'ftp.isu.edu.tw';
tFTP.Port := 21;
tFTP.Username := 'anonymous';
tftp.ProxySettings.ProxyType:=fpcmHttpProxyWithFtp;
tftp.ProxySettings.Host:='139.175.55.210'; //proxy.seed.net.tw:8080
tftp.ProxySettings.Port:=8080; tFTP.Connect;
tftp.get('welcome.msg',aadest,aaresume);
aadest.SaveToFile('c:\zget.gm'); end; 另外要怎樣才能作出像 flashget 一樣, show 出連線的資訊?? , 那些資料在那里回傳的呢? 不好意思, 新手問題...
|
Stallion
版主 發表:52 回覆:1600 積分:1995 註冊:2004-09-15 發送簡訊給我 |
|
蜻蜓草
一般會員 發表:22 回覆:30 積分:10 註冊:2002-03-18 發送簡訊給我 |
|
Stallion
版主 發表:52 回覆:1600 積分:1995 註冊:2004-09-15 發送簡訊給我 |
|
蜻蜓草
一般會員 發表:22 回覆:30 積分:10 註冊:2002-03-18 發送簡訊給我 |
好像不是耶..... procedure TForm1.IdLogEvent1Received(ASender: TComponent; const AText,
AData: String);
begin
memo1.Lines.Add(adata); end; 我加了這些去看連線 , 如果不加
// tftp.ProxySettings.ProxyType:=fpcmTransparent;
// tftp.ProxySettings.Host:='139.175.55.210'; //proxy.seed.net.tw:8080
// tftp.ProxySettings.Port:=8080; 這三行就者正常 , 且有連線資料如下: Memo1
220-歡迎光臨義守大學檔案伺服器
220-
220-本站提供以下軟體可供下載:
220-*******************************************************************************
220-/pub/BeOS/ BeOS 作業系統
220-/pub/CPAN/ Perl 程式語言 (Comprehensive Perl Archive Network)
220-/pub/CPatch/ 中文化軟體 (收集大量的 Windows 共享軟體與中文化程式)
220-/pub/Documents/ 各類文件收集
220-/pub/FreeBSD/ FreeBSD 作業系統
220-/pub/Game/ 免費遊戲軟體
220-/pub/Hardware/ 硬體驅動程式
220-/pub/Linux/ Linux 作業系統
220-/pub/MsDownload/ 微軟相關軟體更新 (例如 Service Pack 等)
220-/pub/RFC/ Request for Comments (RFC 文件)
220-/pub/Solaris/ Solaris 作業系統
220-/pub/Yesterday/ 昨日小築完整 mirror (收集大量 Windows 相關軟體)
220-*******************************************************************************
220-
220-另外,歡迎使用者多多利用 HTTP 的方式登入,一來有較佳的
220-傳輸效能,介面功能也較為完善,您還可以利用檔案搜尋引擎
220-快速找到您所需求的檔案,網址如下:
220-
220-http://ftp.isu.edu.tw
220
230 Login successful.
200 Switching to Binary mode.
215 UNIX Type: L8
350 Restart position accepted (1).
350 Restart position accepted (0).
200 PORT command successful. Consider using PASV.
350 Restart position accepted (0).
150 Opening BINARY mode data connection for welcome.msg (914 bytes).
226 File send OK.
200 NOOP ok.
200 NOOP ok.
200 NOOP ok. 但是只要一加上 proxy 的那 3 行 , 連線資料也都收不到, 就出現 " connection close gracefully" 了
|
Stallion
版主 發表:52 回覆:1600 積分:1995 註冊:2004-09-15 發送簡訊給我 |
|
蜻蜓草
一般會員 發表:22 回覆:30 積分:10 註冊:2002-03-18 發送簡訊給我 |
我試過了 , 執行編譯過的exe 也是會出現吧?? .....不過這不重要反正只要正能常連線的話,再解決就好 問題應是那個 proxy 的部分, 我一直在想是那裡設定錯了.....?
會不會是連上 proxy(139.175.55.210:8080) 後, 沒法子和 proxy 溝通所以才沒有資料?? 不好意思, 第一次寫有關網路的, 實在弄不懂...
我把程式 post 上來, 看能幫忙找到原因嗎...? procedure TForm1.BitBtn1Click(Sender: TObject);
var i:longint;aADest: TMemoryStream ; aAResume:boolean;
begin aadest:=TMemoryStream .Create;
tFTP.Host := 'ftp.isu.edu.tw';
tFTP.Port := 21;
tFTP.Username := 'anonymous';
tftp.ProxySettings.ProxyType:=fpcmHttpProxyWithFtp;
tftp.ProxySettings.Host:='139.175.55.210'; //proxy.seed.net.tw:8080
tftp.ProxySettings.Port:=8080; tFTP.Connect;
tftp.get('welcome.msg',aadest,aaresume);
tftp.Noop;
tftp.Noop;
tftp.Noop;
aadest.SaveToFile('c:\zget.gm'); end; procedure TForm1.IdLogEvent1Received(ASender: TComponent; const AText,
AData: String);
begin
memo1.Lines.Add(adata);
end; procedure TForm1.IdLogEvent1Sent(ASender: TComponent; const AText,
AData: String);
begin
listbox2.Items.Add(adata);
end; procedure TForm1.IdLogEvent1Connect(ASender: TIdConnectionIntercept);
begin
form1.caption:='connection';
end;
|
Stallion
版主 發表:52 回覆:1600 積分:1995 註冊:2004-09-15 發送簡訊給我 |
procedure TForm1.BitBtn1Click(Sender: TObject); var i:longint;aADest: TMemoryStream ; aAResume:boolean; begin aadest:=TMemoryStream .Create; tFTP.Host := 'ftp.isu.edu.tw'; tFTP.Port := 21; tFTP.Username := 'anonymous'; tftp.ProxySettings.ProxyType:=fpcmHttpProxyWithFtp; tftp.ProxySettings.Host:='139.175.55.210'; //proxy.seed.net.tw:8080 tftp.ProxySettings.Port:=8080; tFTP.ProxySettings.UserName := 'XXX'; tFTP.ProxySettings.Password := '123'; tFTP.Connect; tftp.get('welcome.msg',aadest,aaresume); tftp.Noop; tftp.Noop; tftp.Noop; aadest.SaveToFile('c:\zget.gm'); end;ProxyType is a TIdFtpProxyType property that represents the connection and authentication methods permitted for proxied connections to an FTP server. ProxyType is used in TIdFTP.Login to determine the method and values used for authenticating the proxied connection to the FTP server, according to the following proxy type values and methodologies: fpcmNone - Sends the FTP client Username and optional Password. fpcmUserSite - Sends the ProxySettings Username and optional Password, followed immediately by the FTP client Username and optional Password. fpcmSite - Sends the ProxySettings Username and optional Password, sends the SITE command and the FTP Host property, and the FTP client Username and optional Password. fpcmOpen - Sends the ProxySettings Username and optional Password, sends the OPEN command with the FTP Host property, and the FTP client Username and optional Password. fpcmUserPass - Calls SendCmd with the command USER user@proxyuser@host, calls SendCmd with the command PASS pwd@proxypwd, or optionally PASS pwd. fpcmTransparent - Sends the ProxySettings Username and optional Password, followed immediately by the FTP client Username and optional password. fpcmHttpProxyWithFtp - Not implemented at this time. 看看線上說明,你是不是少了ftp proxy的帳號密碼?登入proxy有些也是要帳號密碼的吧! ---------------------------------------------- We will either find a way, or make one. -Hannibal -。 |
蜻蜓草
一般會員 發表:22 回覆:30 積分:10 註冊:2002-03-18 發送簡訊給我 |
|
蜻蜓草
一般會員 發表:22 回覆:30 積分:10 註冊:2002-03-18 發送簡訊給我 |
|
Ktop_Robot
站務副站長 發表:0 回覆:3511 積分:0 註冊:2007-04-17 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |