无法在 C# 中使用 SharpSvn 连接 https 服务器,无法连接到服务器错误

发布于 2024-11-25 16:57:15 字数 1057 浏览 1 评论 0原文

我正在VS2010中开发Windows应用程序。我正在使用 SharpSVN 来连接 subversion 存储库。我尝试使用 svnClient.GetList(targetUri, out list); 函数获取存储库项目。它对于本地(file\\:)存储库工作正常。当我尝试连接 https 服务器时,出现错误。

我曾经对代码规范中给出的 https 服务器进行采样。我也尝试过在 tortoiseSVN 中进行连接。它说“无法连接到服务器”。我已经尝试过 C# 并得到同样的错误。

请参阅下面的 https 服务器 URL 以及

https://svn.codespaces.com/cw/com_codespaces_api_net

username: api_guest
password Password1

我用来连接的代码下面的用户名和密码。

using (SvnClient svnClient = new SvnClient())
  {
svnClient.Authentication.DefaultCredentials = new System.Net.NetworkCredential("api_guest", "Password1");

                SvnTarget targetUri = new SvnUriTarget(new Uri(sourcePath));
                var list = new Collection<SvnListEventArgs>();                
                svnClient.GetList(targetUri, out list);
}

错误消息:

OPTIONS of 'https://svn.codespaces.com/cw/com_codespaces_api_net': could not connect to server (https://svn.codespaces.com)"

我已在 Google 中搜索了解决方案。我无法找到任何帮助。

I am developing Windows application in VS2010. I am using SharpSVN to connect with subversion repository. I have tried to get the repository items using svnClient.GetList(targetUri, out list); function. It is working fine for local(file\\:) repository. When I try to connect the https server, it is giving error.

I have used to sample https server given in codespeces. I have tried in tortoiseSVN also to connect. It is saying "could not connect to server". And I have tried through C# and getting the same error.

Please see below for https server url and username and password

https://svn.codespaces.com/cw/com_codespaces_api_net

username: api_guest
password Password1

below code I have used to connect.

using (SvnClient svnClient = new SvnClient())
  {
svnClient.Authentication.DefaultCredentials = new System.Net.NetworkCredential("api_guest", "Password1");

                SvnTarget targetUri = new SvnUriTarget(new Uri(sourcePath));
                var list = new Collection<SvnListEventArgs>();                
                svnClient.GetList(targetUri, out list);
}

Error Message:

OPTIONS of 'https://svn.codespaces.com/cw/com_codespaces_api_net': could not connect to server (https://svn.codespaces.com)"

I have searched for solution in Google. I am not able to find any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文