简体   繁体   English

使用C#连接到窑库资源库

[英]Connect to Kiln mercurial repository using C#

I use Kiln.Net library to connect to mercurial repository. 我使用Kiln.Net库连接到商品库。 I need to get base information (commits, lines of code changed..). 我需要获取基本信息(提交,代码行已更改..)。 Then it should group that info further to show progress for each author. 然后,它应该将该信息进一步分组以显示每个作者的进度。 But still have no success. 但是仍然没有成功。

Code to connect: 连接代码:

var account = "exampleRepo"; // examplerepo.kilnhg.com
var user = "exampleUsername"; // username
var password = "examplePassword"; // password

using (Kiln myAccount = Kiln.AuthenticateOnDemand(account, user, password)) // Here 404 error
{
    // Returns changeset history for the repository
    Changeset[] changesets;
    changesets = myAccount.GetHistory(repo.ID, 100);

    // Returns the list of all available projects
    Project[] projects;
    projects = myAccount.GetProjects();
    projects = myAccount.Call<Project[]>(KilnApiCall.Projects, null);
}

While debuggin I got that auth URL seems good. 在调试时,我得到的身份验证URL似乎不错。 It is like: 它像是:

https://exampleRepo.kilnhg.com/Kiln/Api/1.0/Auth/Login?sUser=exampleUsername&sPassword=examplePassword

But after execute request I always getting 404 error Not Found. 但是执行请求后,我总是收到404错误未找到。 Thanks in advance for your help 在此先感谢您的帮助

The problem was fixed. 该问题已解决。 Kiln.Net library was generating bad URL. Kiln.Net库生成错误的URL。 Good one is just without "/Kiln": 好人就是没有“ / Kiln”:

https://exampleRepo.kilnhg.com/Api/1.0/Auth/Login?sUser=exampleUsername&sPassword=examplePassword

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM