3

鉴于需要两个不同的修订版本来获得它们之间的差异,我打算使用方法 duvuelve Diff 但我有什么结果,它可能是?谢谢。我的代码如下

using (SvnClient client = new SvnClient())
using (MemoryStream result = new MemoryStream())
{
    client.Authentication.DefaultCredentials = new NetworkCredential("asdf", "asdf/*");
    try
    {
        //SvnUriTarget is a wrapper class for SVN repository URIs
        SvnUriTarget target = new SvnUriTarget(textBox1.Text);
        if (client.Diff(target, rango, result))
            MessageBox.Show("Successfully para" + rango.ToString() + ".");


        StreamReader strReader = new StreamReader(result);

        string str = strReader.ReadToEnd();
    }
}
4

1 回答 1

5

从 Diff() 函数返回的流位于流的末尾,因此在创建流阅读器之前,您需要将其重新定位在流的开头:

result.Position = 0;
StreamReader strReader = new StreamReader(result);
于 2011-02-01T23:27:21.127 回答