zoukankan      html  css  js  c++  java
  • 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;
                    }
    }
  • 相关阅读:
    能用HTML/CSS解决的问题,就不要用JS
    跨域
    从输入url到页面展示到底发生了什么
    hosts 文件
    了解Web及网络基础
    hybrid
    组件化和 React
    MVVM 和 VUE
    虚拟 DOM
    ES6模块化与常用功能
  • 原文地址:https://www.cnblogs.com/cicaday/p/4071474.html
Copyright © 2011-2022 走看看