全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:4792
推到 Plurk!
推到 Facebook!

控制ie打開的ftp網頁?

答題得分者是:malanlk
takdick
一般會員


發表:50
回覆:63
積分:22
註冊:2002-08-05

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-07-27 18:59:08 IP:203.218.xxx.xxx 未訂閱
我知道使用TIEControllerm可控制ie的大部份功能,現請問可否用它做到控制ie打開某ftp網頁,輸入用戶名和密碼登錄,然後實現上傳和下載的功能? 請注意:我是要在MainForm.Button.Click裡實現登錄.上傳,下載等功能,不是在已打開的ie裡操作.可否做到?還是有其他更好方法?但一定要用ie打開ftp網頁. 謝謝. procedure TMainForm.OpenBtnClick(Sender: TObject); begin IEControl := TIEController.Create(Self); IEControl.IEOpen; IEControl.IEVisible := True; IEControl.IEURL :='ftp://server.com' ....... ......... end;
malanlk
尊榮會員


發表:20
回覆:694
積分:577
註冊:2004-04-19

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-07-27 21:36:33 IP:61.219.xxx.xxx 未訂閱
你的 TIEController 是 新增的 Component嗎? 我的 Delphi 7 沒有這個元件.
takdick
一般會員


發表:50
回覆:63
積分:22
註冊:2002-08-05

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-07-28 16:07:57 IP:203.218.xxx.xxx 未訂閱
不是的(我原也以為是delphi的一個類),是從網上下載的源碼. unit IEController; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, shdocvw; type EIEControlError = class(Exception); EIEControlExecError = class(EIEControlError); TIEController = class(TComponent) private { Private declarations } FIE: IWebBrowser2; function GetIEAddressBarVisible: Boolean; function GetIEFullScreen: Boolean; function GetIEHeight: Integer; function GetIELeft: Integer; function GetIEMenuBarVisible: Boolean; function GetIEOffLine: Boolean; function GetIEResizable: Boolean; function GetIESilent: Boolean; function GetIEStatusBarVisible: Boolean; function GetIEStatusText: String; function GetIETheaterMode: Boolean; function GetIEToolbarVisible: Boolean; function GetIETop: Integer; function GetIEVisible: Boolean; function GetIEWidth: Integer; function GetIEURL: String; procedure SetIEAddressBarVisible(const Value: Boolean); procedure SetIEFullScreen(const Value: Boolean); procedure SetIEHeight(const Value: Integer); procedure SetIELeft(const Value: Integer); procedure SetIEMenuBarVisible(const Value: Boolean); procedure SetIEOffline(const Value: Boolean); procedure SetIEResizable(const Value: Boolean); procedure SetIESilent(const Value: Boolean); procedure SetIEStatusBarVisible(const Value: Boolean); procedure SetIEStatusText(const Value: String); procedure SetIETheaterMode(const Value: Boolean); procedure SetIEToolbarVisible(const Value: Boolean); procedure SetIETop(const Value: Integer); procedure SetIEVisible(const Value: Boolean); procedure SetIEURL(const Value: String); procedure SetIEWidth(const Value: Integer); protected { Protected declarations } function IEExecWB(CmdId, CmdOption: Integer; VarIn, VarOut: OleVariant): Boolean; public { Public declarations } function GetIEWindowHandle: HWND; procedure IEClose; procedure IEGoBack; procedure IEGoForward; procedure IEGoHome; procedure IEGoSearch; procedure IEOpen; procedure IEPrint(ShowDlg: Boolean); procedure IEPrintPreview; procedure IERefresh; procedure IESave; procedure IESaveAs(FileName: String); procedure IEShow; procedure IEStop; function IsIEBusy: Boolean; function IsIEOpen: Boolean; property IEAddressBarVisible: Boolean read GetIEAddressBarVisible write SetIEAddressBarVisible; property IEFullScreen: Boolean read GetIEFullScreen write SetIEFullScreen; property IEHeight: Integer read GetIEHeight write SetIEHeight; property IELeft: Integer read GetIELeft write SetIELeft; property IEMenuBarVisible: Boolean read GetIEMenuBarVisible write SetIEMenuBarVisible; property IEOffline: Boolean read GetIEOffline write SetIEOffline; property IEResizable: Boolean read GetIEResizable write SetIEResizable; property IESilent: Boolean read GetIESilent write SetIESilent; property IEStatusBarVisible: Boolean read GetIEStatusBarVisible write SetIEStatusBarVisible; property IEStatusText: String read GetIEStatusText write SetIEStatusText; property IETheaterMode: Boolean read GetIETheaterMode write SetIETheaterMode; property IEToolbarVisible: Boolean read GetIEToolbarVisible write SetIEToolbarVisible; property IETop: Integer read GetIETop write SetIETop; property IEVisible: Boolean read GetIEVisible write SetIEVisible; property IEWidth: Integer read GetIEWidth write SetIEWidth; property IEURL: String read GetIEURL write SetIEURL; published { Published declarations } end; procedure Register; implementation uses ComObj; procedure Register; begin RegisterComponents('DGI', [TIEController]); end; { TIEController } function TIEController.IEExecWB(CmdId, CmdOption: Integer; VarIn, VarOut: OleVariant): Boolean; begin if FIE.QueryStatusWB(CmdId) = OLECMDF_ENABLED OLECMDF_SUPPORTED then try FIE.ExecWB(CmdId, CmdOption, VarIn, VarOut) except raise EIEControlExecError('Command execution failed. (Id: ' IntToStr(CmdId) ')'); end else raise EIEControlExecError.Create('The function you requested is not ' 'available. (Id: ' IntToStr(CmdId) ')'); end; procedure TIEController.IEClose; begin if IsIEOpen then begin FIE.Quit; FIE := nil; end; end; function TIEController.GetIEHeight: Integer; begin if not IsIEOpen then IEShow; Result := FIE.Get_Height; end; function TIEController.GetIELeft: Integer; begin if not IsIEOpen then IEShow; Result := FIE.Get_Left; end; function TIEController.GetIEWindowHandle: HWND; begin try if Assigned(FIE) then Result := FIE.Get_HWND else Result := 0; except Result := 0; end; end; function TIEController.GetIEURL: String; begin if not IsIEOpen then IEShow; Result := FIE.Get_LocationURL; end; function TIEController.GetIEAddressBarVisible: Boolean; begin if not IsIEOpen then IEShow; Result := FIE.Get_AddressBar; end; function TIEController.IsIEBusy: Boolean; begin if not IsIEOpen then IEShow; Result := FIE.Get_Busy; end; function TIEController.GetIEMenuBarVisible: Boolean; begin if not IsIEOpen then IEShow; Result := FIE.Get_MenuBar; end; procedure TIEController.IEOpen; begin FIE := CoInternetExplorer.Create; end; procedure TIEController.SetIEURL(const Value: String); var Flags: OleVariant; TargetFrameName: OleVariant; PostData: OleVariant; Headers: OleVariant; begin if not IsIEOpen then IEShow; FIE.Navigate(Value, Flags, TargetFrameName, PostData, Headers); end; procedure TIEController.SetIEAddressBarVisible(const Value: Boolean); begin if not IsIEOpen then IEShow; FIE.Set_AddressBar(Value); end; procedure TIEController.SetIEVisible(const Value: Boolean); begin if not IsIEOpen then IEShow; FIE.Visible := Value; end; function TIEController.GetIEOffLine: Boolean; begin if not IsIEOpen then IEShow; Result := FIE.Get_Offline; end; function TIEController.GetIEVisible: Boolean; begin if not IsIEOpen then IEShow; Result := FIE.Visible; end; procedure TIEController.SetIEMenuBarVisible(const Value: Boolean); begin if not IsIEOpen then IEShow; FIE.Set_MenuBar(Value); end; procedure TIEController.SetIEHeight(const Value: Integer); begin if not IsIEOpen then IEShow; FIE.Set_Height(Value); end; procedure TIEController.SetIELeft(const Value: Integer); begin if not IsIEOpen then IEShow; FIE.Set_Left(Value); end; procedure TIEController.SetIEOffline(const Value: Boolean); begin if not IsIEOpen then IEShow; FIE.Set_Offline(Value); end; function TIEController.GetIETop: Integer; begin if not IsIEOpen then IEShow; Result := FIE.Get_Top; end; procedure TIEController.SetIETop(const Value: Integer); begin if not IsIEOpen then IEShow; FIE.Set_Top(Value); end; function TIEController.GetIEWidth: Integer; begin if not IsIEOpen then IEShow; Result := FIE.Get_Width; end; procedure TIEController.SetIEWidth(const Value: Integer); begin if not IsIEOpen then IEShow; FIE.Set_Width(Value); end; function TIEController.GetIEFullScreen: Boolean; begin if not IsIEOpen then IEShow; Result := FIE.Get_FullScreen; end; procedure TIEController.SetIEFullScreen(const Value: Boolean); begin if not IsIEOpen then IEShow; FIE.Set_FullScreen(Value); end; function TIEController.GetIEResizable: Boolean; begin if not IsIEOpen then IEShow; Result := FIE.Get_Resizable; end; procedure TIEController.SetIEResizable(const Value: Boolean); begin if not IsIEOpen then IEShow; FIE.Set_Resizable(Value); end; function TIEController.GetIESilent: Boolean; begin if not IsIEOpen then IEShow; Result := FIE.Get_Silent; end; procedure TIEController.SetIESilent(const Value: Boolean); begin if not IsIEOpen then IEShow; FIE.Set_Silent(Value); end; function TIEController.GetIEStatusBarVisible: Boolean; begin if not IsIEOpen then IEShow; Result := FIE.Get_StatusBar; end; procedure TIEController.SetIEStatusBarVisible(const Value: Boolean); begin if not IsIEOpen then IEShow; FIE.Set_StatusBar(Value); end; procedure TIEController.SetIEStatusText(const Value: String); begin if not IsIEOpen then IEShow; FIE.Set_StatusText(Value); end; function TIEController.GetIEStatusText: String; begin if not IsIEOpen then IEShow; Result := FIE.Get_StatusText; end; function TIEController.GetIETheaterMode: Boolean; begin if not IsIEOpen then IEShow; Result := FIE.Get_TheaterMode; end; procedure TIEController.SetIETheaterMode(const Value: Boolean); begin if not IsIEOpen then IEShow; FIE.Set_TheaterMode(Value); end; function TIEController.GetIEToolbarVisible: Boolean; var Visible: Integer; begin if not IsIEOpen then IEShow; Visible := FIE.Get_Toolbar; if Visible = 0 then Result := False else Result := True; end; procedure TIEController.SetIEToolbarVisible(const Value: Boolean); begin if not IsIEOpen then IEShow; if Value then FIE.Set_ToolBar(1) else FIE.Set_ToolBar(0); end; procedure TIEController.IEGoBack; begin if not IsIEOpen then IEShow; try FIE.GoBack; except end; end; procedure TIEController.IEGoForward; begin if not IsIEOpen then IEShow; try FIE.GoForward; except end; end; procedure TIEController.IEGoHome; begin if not IsIEOpen then IEShow; FIE.GoHome; end; procedure TIEController.IEGoSearch; begin if not IsIEOpen then IEShow; FIE.GoSearch; end; procedure TIEController.IERefresh; begin if not IsIEOpen then IEShow; FIE.Refresh; end; procedure TIEController.IEShow; begin IEOpen; IEVisible := True; end; function TIEController.IsIEOpen: Boolean; begin if GetIEWindowHandle = 0 then Result := False else Result := True; end; procedure TIEController.IEPrint(ShowDlg: Boolean); var V: OleVariant; begin if ShowDlg then IEExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DODEFAULT, V, V) else IEExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, V, V); end; procedure TIEController.IEPrintPreview; var V: OleVariant; begin IEExecWB(OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_DODEFAULT, V, V); end; procedure TIEController.IESave; var V: OleVariant; begin IEExecWB(OLECMDID_SAVE, OLECMDEXECOPT_DODEFAULT, V, V); end; procedure TIEController.IESaveAs(FileName: String); var VarIn, VarOut: OleVariant; begin VarIn := FileName; IEExecWB(OLECMDID_SAVEAS, OLECMDEXECOPT_DODEFAULT, VarIn, VarOut); end; procedure TIEController.IEStop; var V: OleVariant; begin IEExecWB(OLECMDID_STOP, OLECMDEXECOPT_DODEFAULT, V, V); end; end.
00156
高階會員


發表:45
回覆:195
積分:112
註冊:2002-06-01

發送簡訊給我
#4 引用回覆 回覆 發表時間:2005-07-28 20:34:03 IP:61.56.xxx.xxx 未訂閱
您好: 如果只是單純登錄ftp,試試看下面的URL格式可不可行~ ftp://Your_Account:Your_Password@domain.com.tw 或者,用WebBrowser模擬登錄動作試試看,以前試驗過kimo和geocities的網頁上傳檔案沒有問題。大致上先進入登錄網頁,然後在onDocumentComplete事件裡依序填入username和password欄位、模擬按下登錄(submit)、打開上傳那頁、模擬按下[瀏覽檔案]按鈕、模擬按下[上傳]按鈕…可能要先分析各網頁的表單看看。或許這個方法比較麻煩些吧?不知道合不合用?
malanlk
尊榮會員


發表:20
回覆:694
積分:577
註冊:2004-04-19

發送簡訊給我
#5 引用回覆 回覆 發表時間:2005-07-28 22:05:27 IP:210.68.xxx.xxx 未訂閱
由你 PO 的源碼看起來, 無法做到 "輸入用戶名和密碼登錄,然後實現上傳和下載的功能" 因為該元件並沒有提供 property 或 method 存取用該元件啟動的IE的內容.
malanlk
尊榮會員


發表:20
回覆:694
積分:577
註冊:2004-04-19

發送簡訊給我
#6 引用回覆 回覆 發表時間:2005-07-29 17:31:42 IP:203.69.xxx.xxx 未訂閱
想了好久, 看來唯一的辦法就是 hook ie 的 DocumentComplete event, 再把所有的內容抓出來比對, 再想辦法填資料進去.....要想一陣子....
takdick
一般會員


發表:50
回覆:63
積分:22
註冊:2002-08-05

發送簡訊給我
#7 引用回覆 回覆 發表時間:2005-07-29 18:39:17 IP:203.218.xxx.xxx 未訂閱
或許可簡單些,我要上傳或下載的文件可以是指定的,如下載ftp server上的temp.exe,上傳我的電腦裡的c:\test.exe 真謝謝你的熱心幫助.
malanlk
尊榮會員


發表:20
回覆:694
積分:577
註冊:2004-04-19

發送簡訊給我
#8 引用回覆 回覆 發表時間:2005-07-29 18:48:08 IP:203.69.xxx.xxx 未訂閱
ㄧ定要用 ie 嗎? 用 TIdFtp 會簡單許多, 我以為你是想控制 ie.
takdick
一般會員


發表:50
回覆:63
積分:22
註冊:2002-08-05

發送簡訊給我
#9 引用回覆 回覆 發表時間:2005-07-29 18:58:14 IP:203.218.xxx.xxx 未訂閱
沒錯,我是要控制ie. idftp,nmftp,dos command 'ftp'我都會用. 控制ie登錄ftp server我知道很麻煩,但有我的作用. 請你幫忙.
00156
高階會員


發表:45
回覆:195
積分:112
註冊:2002-06-01

發送簡訊給我
#10 引用回覆 回覆 發表時間:2005-07-29 20:34:09 IP:61.56.xxx.xxx 未訂閱
我在下面的位置上傳了一個例子,因為Geocities的網站不支援ftp(免費會員),只好自己寫程式模擬檔案上傳。其他有關檔案的刪除、更名等等,可以先分析各網頁的連結字串(參數)再改寫。 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=75875    僅供您參考看看
takdick
一般會員


發表:50
回覆:63
積分:22
註冊:2002-08-05

發送簡訊給我
#11 引用回覆 回覆 發表時間:2005-07-30 18:14:26 IP:219.77.xxx.xxx 未訂閱
請問00156: 上傳文件的網址:wb.Navigate('http://geocities.yahoo.com/filemanager?directory=' s '&op-uploadtodir'); 你是如何得到的? 另外我不想使用TWebBrowser控件,而直接控制IE,可否? var ie: olevariant; begin ie:=CreateOleObject('InternetExplorer.Application'); ie.Visible:=true; ie.Navigate('http://geocities.yahoo.com'); .... ..... 發表人 - takdick 於 2005/07/30 18:25:26
00156
高階會員


發表:45
回覆:195
積分:112
註冊:2002-06-01

發送簡訊給我
#12 引用回覆 回覆 發表時間:2005-07-30 21:26:36 IP:61.56.xxx.xxx 未訂閱
引言: 上傳文件的網址:wb.Navigate('http://geocities.yahoo.com/filemanager?directory=' s '&op-uploadtodir'); 你是如何得到的?
我是先分析上傳那一頁的表單裡有哪些參數,然後再測試看看
引言: 另外我不想使用TWebBrowser控件,而直接控制IE,可否? var ie: olevariant; begin ie:=CreateOleObject('InternetExplorer.Application'); ie.Visible:=true; ie.Navigate('http://geocities.yahoo.com'); .... .....
TWebBrowser就是直接封裝Microsoft的SHDOCVW.DLL介面,直接使用不是比較方便嗎?若要直接控制OLE物件我也不太熟悉,您參考看看下面的連結: http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/prog_browser_node_entry.asp
malanlk
尊榮會員


發表:20
回覆:694
積分:577
註冊:2004-04-19

發送簡訊給我
#13 引用回覆 回覆 發表時間:2005-07-31 10:44:02 IP:61.219.xxx.xxx 未訂閱
我的解決方式 基本上是參考這篇 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebgen/html/bho.asp 等寫完會做個發表, 你可以先研究一下這篇的內容
takdick
一般會員


發表:50
回覆:63
積分:22
註冊:2002-08-05

發送簡訊給我
#14 引用回覆 回覆 發表時間:2005-07-31 19:40:35 IP:218.102.xxx.xxx 未訂閱
引言: [quote] 上傳文件的網址:wb.Navigate('http://geocities.yahoo.com/filemanager?directory=' s '&op-uploadtodir'); 你是如何得到的?
我是先分析上傳那一頁的表單裡有哪些參數,然後再測試看看 [quote] 請問你是如何分析的呀?原始檔裡沒有這一句,地址欄也沒有,我去其他的論壇問過別人,但沒人能答,請你再指教.
00156
高階會員


發表:45
回覆:195
積分:112
註冊:2002-06-01

發送簡訊給我
#15 引用回覆 回覆 發表時間:2005-07-31 21:59:32 IP:61.56.xxx.xxx 未訂閱
引言: 請問你是如何分析的呀?原始檔裡沒有這一句,地址欄也沒有,我去其他的論壇問過別人,但沒人能答,請你再指教.
  • 登錄Geocities後,在File Manager那一頁裡有各項操作的按鈕,因此,進入那一頁打開原始檔案。
  • 找到含有Upload Files按鈕的那個表單,其中的Action="/filemanager",也就是表單最後傳送到http://geocities.yahoo.com/filemanager
  • 找找表單裡面的欄位<input...>,因為欄位很多,所以我刪掉看起來不太用得到的欄位試驗看看。當然,也可以全部保留。
  • 表單的資料在傳送時(GET方法),會以搜尋字串(Search String)附加在網址後面,因此將各欄位值改成Search String格式傳送。
當然,每個支援檔案上傳的網頁使用不同的CGI,接收的表單與欄位都會不一樣。你試試看這樣的方式分析,看看行不行得通。祝好運!
conundrum
尊榮會員


發表:893
回覆:1272
積分:643
註冊:2004-01-06

發送簡訊給我
#16 引用回覆 回覆 發表時間:2005-08-01 00:56:53 IP:218.175.xxx.xxx 未訂閱
時間可以的話 你可以查    IE & Delphi網站 http://delphi.ktop.com.tw/showenews.asp?topic_id=32810 http://www.euromind.com/iedelphi/ 這一篇也可以看看  http://delphi.ktop.com.tw/topic.php?topic_id=58492    庵不知道為甚麼一定要IE 但你又不用此元件 如果沒記錯 你要的方式 在m8815010 版主的討論文中應該有的 哈哈 http://delphi.ktop.com.tw/pop_profile.asp?mode=display&id=16732    如果類似這樣可以嗎? 參數傳遞 ftp://ip:帳號@秘碼/ http://ip:port.帳號@秘碼/ 原來庵攪錯 哈哈    再給一個另類思考 鳥哥的 Linux 與 ADSL 私房菜  http://linux.vbird.org/linux_server/0220upgrade.php VBird 的自動更新程式 呵呵!在經過一段時間的改寫之後,終於使用 lynx 以及 wget 完成了一個可以自動更新 Linux 系統的 script 了!我是利用中山大學的 FTP 網站來進行 RPM 檔案的下載與分析的!而由於這個程式是使用 FTP 網站的資料,並且利用比對的方式來找出自己所需要的套件,所以呢,基本上程式應該是能夠符合使用 RPM 安裝的 Linux 系統的,目前我在 Red Hat 以及 Mandrake 系統上面測試過這個程式,都沒有問題!理論上, Open Linux 以及其他使用 RPM 方式來安裝套件的 Linux 系統應該都可以使用這支程式才是!    這支程式主要的工作流程圖是這樣的:     剛剛找一下的 【Delphi】【轉貼】開發嵌入式IE流覽器監控程序 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=75954 簡體的 自己轉把 有bug 不負責 哈哈 malanlk 兄 庵老了 看不懂 聖下的給你處理看看 累積 vs 快速 不一定在短期中 發表人 - conundrum 於 2005/08/01 01:31:02
takdick
一般會員


發表:50
回覆:63
積分:22
註冊:2002-08-05

發送簡訊給我
#17 引用回覆 回覆 發表時間:2005-08-09 15:05:30 IP:218.102.xxx.xxx 未訂閱
謝謝大家的幫忙. 不過實在是水平有限,搞了幾天還是毫無頭緒,可以的話請大家給個源碼吧. malanlk 兄:你還有在幫我寫嗎?期待中... 謝謝.
malanlk
尊榮會員


發表:20
回覆:694
積分:577
註冊:2004-04-19

發送簡訊給我
#18 引用回覆 回覆 發表時間:2005-08-09 15:40:16 IP:203.69.xxx.xxx 未訂閱
有在寫, 快寫完了, 可是很亂, 在整理中...
malanlk
尊榮會員


發表:20
回覆:694
積分:577
註冊:2004-04-19

發送簡訊給我
#19 引用回覆 回覆 發表時間:2005-08-10 01:39:20 IP:61.219.xxx.xxx 未訂閱
http://delphi.ktop.com.tw/topic.php?TOPIC_ID=76507 發表了一個範例, 在這個範例中, 可以取得系統中每個 IE 的 IWebBrowser2 介面, 加上KTop上對 TWebBrowser 各式各樣的應用似乎可以用在這個程式所取得的 IWebBrowser2 介面上... 範例不大應該可以輕鬆看完. 版權沒有, 翻改不究
takdick
一般會員


發表:50
回覆:63
積分:22
註冊:2002-08-05

發送簡訊給我
#20 引用回覆 回覆 發表時間:2005-08-10 18:00:51 IP:218.102.xxx.xxx 未訂閱
malanlk兄: 還是那句話,水平實在有限,看不明白. 能否教我如何控制ftp網頁,實現以下4個功能? procedure TForm_IeSpy.loginClick(Sender: TObject); begin 登錄('ftp://user:pass@ftp.host.com'); end; procedure TForm_IeSpy.uploadClick(Sender: TObject); begin 上傳文件('c:\temp.txt','temp.txt'); end; procedure TForm_IeSpy.downloadClick(Sender: TObject); begin 下載文件('temp.txt','c:\temp.txt'); end; procedure TForm_IeSpy.closeClick(Sender: TObject); begin 關閉ie; end;
malanlk
尊榮會員


發表:20
回覆:694
積分:577
註冊:2004-04-19

發送簡訊給我
#21 引用回覆 回覆 發表時間:2005-08-10 18:28:21 IP:203.69.xxx.xxx 未訂閱
to takdick: 我發了一封線上簡訊, 請收一下...
takdick
一般會員


發表:50
回覆:63
積分:22
註冊:2002-08-05

發送簡訊給我
#22 引用回覆 回覆 發表時間:2005-08-10 18:54:22 IP:218.102.xxx.xxx 未訂閱
已回覆.
malanlk
尊榮會員


發表:20
回覆:694
積分:577
註冊:2004-04-19

發送簡訊給我
#23 引用回覆 回覆 發表時間:2005-08-11 11:38:14 IP:203.69.xxx.xxx 未訂閱
To: takdick  因應您的要求我將範例加了 一些元件 Button --> ChangeURL Button --> CloseIE Button --> RefreshSelectedIE    1. 啟動一個新的 IE 2. 啟動 IESpy 3. 按 Refresh 你會看到你剛剛啟動的 Ie 在 list 內 4. 選定 剛剛啟動的 Ie  5. Edit4 輸入 ftp://userid:pass@ftp.host.sk, 然後按 ChangeURL, 就會連上 FTP Server. 6. FTP 上傳/下載 (自己用 TIdFtp 寫, 你說你會的) 7. 上傳成功後按 RefreshSelectedIE 你就會看到你上傳的檔案 8. 按 CloseIE 關閉該 IE 希望你自己寫 TIdFtp 是因為我用 Spy 查過了, 當你在 IE 的網址欄輸入 ftp://.... 時 IE 會扣進使用 ftp protocol 的 COM 元件(也提供 IWebBrowser2 interface) 但是對應的 event 完全不對....這問題困擾我一個晚上... 起床後才想起在 Server 端應該只有 FTP Server, 使用的應該是 port 21. 所以 IE 造成一個假象, 好像檔案是透過 port 80 送出去的...怪我自己太笨.. 其實你在上傳檔案時你可以用 netstat -na 去看, 你會看到 server 端的 port 確實是 21. 因此可以確定 IE 扣進的 COM 元件 是使用 FTP protocol 的....我目前無法操控該 COM 元件, 所以上傳下載就使用 TIdFtp 去做吧, 反正最後的結果都是一樣的... 發表人 - malanlk 於 2005/08/11 11:43:02 發表人 - malanlk 於 2005/08/11 11:50:08
takdick
一般會員


發表:50
回覆:63
積分:22
註冊:2002-08-05

發送簡訊給我
#24 引用回覆 回覆 發表時間:2005-08-11 16:55:59 IP:203.218.xxx.xxx 未訂閱
還有一請教,請看簡訊.
malanlk
尊榮會員


發表:20
回覆:694
積分:577
註冊:2004-04-19

發送簡訊給我
#25 引用回覆 回覆 發表時間:2005-08-12 11:41:02 IP:203.69.xxx.xxx 未訂閱
to takdick:     針對你簡訊提供的網頁加了一個按鍵, 放ㄧ個檔案 c:\aaa.txt 以便上傳 thread 只會上傳這個檔案    我的程式碼是針對下列格式做的 ("*****..." 是保護takdick的網站所以未列出)    <form ENCTYPE="multipart/form-data" method=post action="http://*******************">
選擇檔案: <input type=file name="uploaded_file"> <input type=hidden name="directory" value="******************"> <input type=submit value="上傳"> </form></center> 其他想自己試試看的請自行修改程式....
takdick
一般會員


發表:50
回覆:63
積分:22
註冊:2002-08-05

發送簡訊給我
#26 引用回覆 回覆 發表時間:2005-08-13 15:03:26 IP:218.103.xxx.xxx 未訂閱
問題已解決,還學到了很多東西. 謝謝各位的熱心幫助,特別是malanlk兄. 日後還望多多指教.
系統時間:2024-05-06 1:01:44
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!