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();
コンパイルされていません '外部'という名前は現在のコンテキストに存在しません –
このユーザーにはどのような権限が必要ですか?私たちはまだ例外 –
@ thabet084を持っているので、完全なパーミッションを持つユーザを配置し、彼の詳細を上記のコードに入れてください。 –