1
我想在服務器路徑中編寫一個文件,但是當我試圖做到這一點時,我們得到了異常,我們沒有權限這樣做。我們誰有權在服務器路徑編寫一個應用程序ID和密碼,但我不知道我可以通過這個證書:如何在寫入服務器路徑中的文件時傳遞憑據?
我當前的代碼:
//Create a new GUID, extract the extension and create a new unique filename
string strFileGUID = System.Guid.NewGuid().ToString();
string extension = Path.GetExtension(attachment.AttachmentFileName);
string tempfilename = strFileGUID + extension;
string path = "ServerPath";
//Open a filestream and write the contents of the file at server path
FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write);
fs.Write(fileContent.Content, 0, fileContent.Content.Length);
fs.Flush();
fs.Close();
未編譯名稱'External'在當前上下文中不存在 –
此用戶需要什麼權限?因爲我們仍然有一個例外 –
@ thabet084作爲開始 - 將具有完全權限的用戶放在上面的代碼中。 –