Вопрос

Я хочу скачать файл в определенную папку.Я использую WebClient.DownloadFile, но что я хотел бы, чтобы пользователь выбрал, где этот файл будет сохранен, не просто загрузите его в любую папку.

Как я могу сделать это?

Это было полезно?

Решение

The folder that the user would download the file to would depend on their browser, and system settings.

All you can do is provide the file to download, and it would be up to them (and their browser) to select a local folder (on their system).

If you want to control that process, you would have to use an embedded plugin like Java, Silverlight, Flash, etc.

Другие советы

If you are using Windows Forms, you can use the SaveFileDialog class to allow the users to pick a file name, and then pass that name to the second parameter of WebClient.DownloadFile.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top