最佳答案
我已经创建了一个应用程序密码解释 给你
但是现在,如何使用这个应用程序密码访问存储库呢?< br > 网址是什么?< br > 有没有人能给我一个示例页面?
下面是 github 的代码。我如何为 bitbucket 做到这一点?
var githubToken = "[token]";
var url = "https://github.com/[username]/[repository]/archive/[sha1|tag].zip";
var path = @"[local path]";
using (var client = new System.Net.Http.HttpClient())
{
var credentials = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}:", githubToken);
credentials = Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(credentials));
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", credentials);
var contents = client.GetByteArrayAsync(url).Result;
System.IO.File.WriteAllBytes(path, contents);
}
转到 个人设定,然后 应用程序密码,如下所示。