我有一个.aspx
页面在我的项目里面有一个<a>
链接下载.txt
文件。ShellClass.BrowseForFolder(...)DialogBox没有显示
正在使用Shell32.ShellClass
和Shell32.Folder2
用于显示浏览文件夹为要求用户在哪里,你要保存的文件,而不是将其下载的默认文件夹Downloads
。
下面是我的C#
显示DialogBox的代码。
Shell32.ShellClass shell = new Shell32.ShellClass();
Shell32.Folder2 flder = (Shell32.Folder2)shell.BrowseForFolder(0, "Select destination folder", 0,"Desktop");
if (flder == null)
{
dlgResult = DialogResult.Cancel;
}
else
{
strPath = flder.Self.Path;
dlgResult = DialogResult.OK;
File.WriteAllText(strPath + "\\NewFile.txt", "file content abc tex...");
}
问题:上面的代码工作正常,在当地但是当我在IIS主办的网站它不工作,不显示对话框。
在IIS中是否有任何特定的设置或配置?或者为什么它在IIS中托管时不工作?
请给我建议。
谢谢。