检查SVN是否已更新C#

时间:2013-04-23 14:30:17

标签: c# svn batch-file svn-update

我正在尝试检查svn是否已更新,我不想使用SharpSVN。 我正在尝试使用Process类。

批处理,我通常会这样做:svn st -u <svn path> | find "*"

这是我的代码:

private void checkSVN()
{
        Process newProcess= new Process();
        newProcess.StartInfo.FileName = "svn";
        newProcess.StartInfo.WorkingDirectory = "";
        newProcess.StartInfo.Arguments = "st -u C:\\SVN | find " + @"""*""";
        newProcess.StartInfo.UseShellExecute = false;
        newProcess.StartInfo.RedirectStandardOutput = true;
        newProcess.OutputDataReceived += new DataReceivedEventHandler(parseStandartOutput);

        newProcess.Start();
        newProcess.BeginOutputReadLine();
}
private static void parseStandartOutput(object sendingProcess, DataReceivedEventArgs outLine)
{
    if (!String.IsNullOrEmpty(outLine.Data))
        m_svnOutput += outLine.Data + " ";
}

问题是find "*"不起作用 - newProcess.StartInfo.Arguments设置为"st -u C:\\SVN | find \"*\*"",当然,这不起作用。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

您是否尝试过简单

        newProcess.StartInfo.Arguments = "st -u C:\\SVN | find \"*\"";
相关问题