这段代码原本在C盘上运行良好,但现在我们将其移动到了一个UNC路径\share上,似乎无法重新加载配置文件。没有错误提示,Filezilla正常工作,我可以连接并在这个UNC共享上传输文件,但是通过代码无法实现预期的功能。我需要做一些特殊的凭据吗?我的应用程序池用户账户与共享账户相同。
Process.Start("CMD.exe", "/C \"\\filezilla\\FileZilla Server.exe\" /reload-config");
更新
我在实际电脑上的命令提示符中运行了这条命令,并且它达到了预期的效果。
另一个更新
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
/C "\\filezilla\FileZilla Server.exe" /reload-config
。 - Mike FlynnCMD.exe /C "\\filezilla\FileZilla Server.exe" /reload-config
,以查看是否有任何错误。(我相信您已经这样做了,但请检查语法是否匹配)。 - Tone