問題描述
當用戶瀏覽到 ftp 位置時,我遇到了打開文件對話的問題.我從 openFileDialogue 獲得的路徑是本地路徑(本地設置臨時文件夾),而不是我選擇的實際 ftp 路徑.如何獲取實際的 ftp 路徑.
I have an issue with open file dialogue when the user browse into an ftp location. The path i get from the openFileDialogue is a local path (Local Setting temp folder) instead of the actual ftp path I selected. How to get the actual ftp path.
推薦答案
您在哪個版本的 Windows 上運行/測試?
What version of Windows are you running/testing on?
Windows 7 有一個功能(不確定它是否也在 Vista 中,甚至可能是 XP),如果您指定一個 Web 位置(無論是 http 還是 ftp),Windows 會從該位置下載文件并傳遞路徑下載的文件,因此 Temp 文件夾,應用程序.據我所知,msdn 上的 OpenFileDialog 文檔 無法禁用此行為.
There's a feature of Windows 7 (not sure if it's in Vista as well, or perhaps even XP) where if you specify a web location (be it http or ftp), Windows downloads the file from that location and passes the path of the downloaded file, hence the Temp folder, to the application. As far as I can tell from the OpenFileDialog documentation on msdn there's no way to disable this behaviour.
您必須推出自己的實現,或者看看是否有一個 PInvoke 方法可以用來說服它不要表現出這種行為.
You'll have to either roll your own implementation, or see if there's a PInvoke method you can use to persuade it not to exhibit this behaviour.
這篇關于打開 FTP 位置的文件對話框的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!