无法在 C# 中使用 SharpSvn 连接 https 服务器,无法连接到服务器错误
我正在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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论