ShareSVN授权的代码示例

            var targetUrl = "your svn url path";
var path = "Temp";
System.Collections.ObjectModel.Collection<SvnLogEventArgs> logEventArgs; using (var client = new SvnClient())
{
try
{
client.Authentication.Clear();
client.Authentication.DefaultCredentials = new System.Net.NetworkCredential("user", "password"); client.Authentication.SslServerTrustHandlers += delegate(object sender, SvnSslServerTrustEventArgs e)
{
e.AcceptedFailures = e.Failures;
e.Save = true; // Save acceptance to authentication store
}; // Checkout SvnCheckOutArgs a = new SvnCheckOutArgs(); if (Directory.Exists(path))
{
Directory.Delete(path, true);
} var target = new SvnUriTarget(targetUrl);
client.CheckOut(target, path, a); // Get log history
client.GetLog(path, out logEventArgs);
foreach (var item in logEventArgs)
{
Console.WriteLine("r{0} - {1}: {2}", item.Revision, item.Author, item.LogMessage);
}
}
catch (Exception)
{
throw;
}
}
上一篇:JavaScript高级程序设计学习笔记第二章


下一篇:windows下的BT服务器搭建方案