Open File Dialogue for FTP location(打开 FTP 位置的文件对话框)
问题描述
当用户浏览到 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 位置的文件对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:打开 FTP 位置的文件对话框
基础教程推荐
- C# 从 List<List<int>> 中删除重 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- WPF 模态进度窗口 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
