c# - 使用 C# ProcessStartInfo 运行 privoxy

标签 c# .net process

当我尝试运行 privoxy 时,我不断收到此错误 can't check configuration file 'config.txt: error number 0'

static void StartPrivoxy(Process p)
{
    p.StartInfo = new ProcessStartInfo(@"C:\Program Files (x86)\Privoxy\privoxy.exe");
    p.Start();
}

目录应该是正确的。我可以在 C:\Program Files (x86)\Privoxy\的命令提示符下运行它,然后双击它。配置在同一目录中。

我使用相同的代码来运行其他程序。

最佳答案

您是否尝试过为进程设置工作目录?

    static void StartPrivoxy(Process p)
    {
        p.StartInfo = new ProcessStartInfo(@"C:\Program Files (x86)\Privoxy\privoxy.exe");
        p.StartInfo.WorkingDirectory = @"C:\Program Files (x86)\Privoxy\";
        p.Start();
    } 

关于c# - 使用 C# ProcessStartInfo 运行 privoxy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7816730/

相关文章:

c# - 强制外部进程在一段时间后被杀死

tcp - 进程和 TCPSocket 在 Crystal 中没有正确关闭

c# - 如何创建一个带有指向另一个窗口的箭头的窗口?

c# - [C#]不插入数据库,但给出executeExecutequery为1

c# - 在WPF中使用MVVM将筛选器文本框添加到组合框

c# - DDD/DI (Unity)/.NET/Composition Root - 领域服务

c# - 使用 VS Isolated Shell 作为 UI 脚手架

c - 向 C 中的 pthreads 发送和捕获信号

python - 如何在Python中执行这个unix进程?连接参数时出现问题

c# - 使用 LINQ 查找对称差异