2008-09-25 51 views
0

給人一種URL到TOpenFileDialog,Execute方法拋出一個異常:德爾福:OpenFileDialog的崩潰與URL

OpenDialog1.Filename := 'http://www.osfi-bsif.gc.ca/app/DocRepository/1/eng/issues/terrorism/indstld_e.xls'; 
bResult := OpenDialog1.Execute; 

但你被允許從URL打開的文件。

德爾福5

回答

3

TOpenDialog只是在COMDLG32.DLL Windows函數GetOpenFileName的包裝。

function TOpenDialog.Execute(ParentWnd: HWND): Boolean; 
begin 
    Result := DoExecute(@GetOpenFileName, ParentWnd); 
end; 

不幸的是documentation這個功能並不是那麼好。但我很確定它不支持http。

+0

好神聖的廢話。嘗試使用記事本並在打開的文件對話框中輸入http://www.google.com/robots.txt。 – Blorgbeard 2008-09-26 04:32:57