サーバーパスにファイルを書きたいのですが、それをしようとすると、それを行う権限がないという例外が発生しました。サーバー パスでの書き込み権限を持つアプリケーション 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();