我编写了一个 asp.net webapp,它将文件写入 iSeries FileShare 上的某个位置。路径如下所示:\IBMServerAddress\Filepath
此代码在我的本地计算机上完美执行,但在部署到我的(Windows)WebServer 时失败。
我知道我可能需要进行某种模拟来验证对 IFS 的访问,但我不确定如何继续。
这是我正在使用的代码:
string filepath = "\\\\IBMServerAddress\\uploads\\";
public int SaveToDisk(string data, string plant)
{
//code for saving to disk
StreamWriter stream = null;
stream = File.CreateText(filepath + plant + ".txt"); // creating file
stream.Write(data + "\r\n"); //Write data to file
stream.Close();
return 0;
}
同样,此代码在我的本地计算机上完美执行,但在部署到我的 Windows WebServer 时不起作用 - 拒绝访问文件路径。
谢谢你的帮助。
编辑:我尝试添加与 IFS 用户具有相同凭据的网络帐户,在 IIS7 上创建了一个 UNC 路径(系列)以映射网络驱动器(使用相同的凭据)-但收到此错误:
拒绝访问路径 'iseries\'。