[英]MVC Application is working fine in IIS Express but not working in Local IIS web server
I have created a web application to open a file (Whatever like notepad, excel, PDF, etc.) in local directory. 我已经创建了一个Web应用程序来打开本地目录中的文件(无论是记事本,Excel,PDF等)。 File is opening when running it in IIS Express but in IIS local Web server, it's not opening the file.
在IIS Express中运行文件时,文件正在打开,但是在IIS本地Web服务器中,它没有打开文件。
I have the files inside the project in Visual studio. 我在Visual Studio项目中有文件。
System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(@"D:// Path ");
IEnumerable<System.IO.FileInfo> fileList = dir.GetFiles("*.*");
var newestFile =
(from file in fileList
//where file.Contains(para)
orderby file.CreationTime
where file.FullName.Contains(para)
select new { file.FullName, file.CreationTime })
.Last();
Process.Start(newestFile.FullName);
return "";
Try creating a virtual directory with path D:// Path. 尝试使用路径D://路径创建虚拟目录。 Try giving proper permissions to the folder.
尝试赋予该文件夹适当的权限。
Give proper permission to IISUser for the folder in which you are storing the files. 为IISUser授予您在其中存储文件的文件夹的适当权限。
Hope this would help. 希望这会有所帮助。
听起来可能是用户权限,请检查为D://路径设置了哪些安全权限,以及它们与您的有效权限有何不同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.