[英]MVC Application is working fine in IIS Express but not working in Local IIS web server
我已經創建了一個Web應用程序來打開本地目錄中的文件(無論是記事本,Excel,PDF等)。 在IIS Express中運行文件時,文件正在打開,但是在IIS本地Web服務器中,它沒有打開文件。
我在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 "";
嘗試使用路徑D://路徑創建虛擬目錄。 嘗試賦予該文件夾適當的權限。
為IISUser授予您在其中存儲文件的文件夾的適當權限。
希望這會有所幫助。
聽起來可能是用戶權限,請檢查為D://路徑設置了哪些安全權限,以及它們與您的有效權限有何不同。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.