更新时间:2022-03-03 06:47:38
您可以尝试在启动流程时设置工作目录:
You may try setting the working directory when you start your process:
Directory.SetCurrentDirectory(
Path.GetDirectoryName(
Assembly.GetExecutingAssembly().Location
)
);
如果您稍后尝试通过指定相对路径来访问与进程可执行文件相同的目录中的文件,它应该能够找到它.
If you later try accessing a file in the same directory as the process executable by specifying a relative path it should be able to find it.