且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 C# 中以编程方式获取 SVN 修订描述和作者?

更新时间:2023-02-12 19:19:41

使用 SharpSvn:

using(SvnClient client = new SvnClient())
{
    Collection<SvnLogEventArgs> list;

    // When not using cached credentials
    // c.Authentication.DefaultCredentials = new NetworkCredential("user", "pass")l

    SvnLogArgs la = new SvnLogArgs { Start = 128, End = 132 };
    client.GetLog(new Uri("http://my/repository"), la, out list);

    foreach(SvnLogEventArgs a in list)
    {
       Console.WriteLine("=== r{0} : {1} ====", a.Revision, a.Author);
       Console.WriteLine(a.LogMessage);
    }
}