Mik*_*ynn 3 c# command-line file-permissions unc azure
此代码以下用于安装它的C驱动器.我们将它移动到UNC路径\ share,现在它似乎没有重新加载配置文件.有没有错误,FileZilla中工作得很好,我可以连接并在此UNC共享传输文件了,但代码我不能得到这种真正做什么它猜想了.我需要明智地做任何特殊凭证吗?我的网站应用程序池的用户帐户与共享相同.
Process.Start("CMD.exe", "/C \"\\filezilla\\FileZilla Server.exe\" /reload-config");
Run Code Online (Sandbox Code Playgroud)
更新
我从实际计算机上的命令提示符处运行此行,它执行了它的设想.
另一个更新
var path = string.Format("/C \"{0}FileZilla Server.exe\" /reload-config", Config.Paths.FileZillaPath); // \\filezilla\
Process.Start("CMD.exe", path);
Logger.Debug("Path: " + path); // Path: /C "\\filezilla\FileZilla Server.exe" /reload-config
Run Code Online (Sandbox Code Playgroud)
Ton*_*one 10
UNC路径中的第一对反斜杠未正确转义,将导致单个反斜杠.尝试
Process.Start("CMD.exe", "/C \"\\\\filezilla\\FileZilla Server.exe\" /reload-config");
Run Code Online (Sandbox Code Playgroud)
您可以在MSDN上看到一个示例
string g ="\\\\ server \\ share \\ file.txt"; // \\ server\share\file.txt
string h = @"\\ server\share\file.txt"; // \\ server\share\file.txt
| 归档时间: |
|
| 查看次数: |
386 次 |
| 最近记录: |