我已按照此处的说明创建了一个应用程序密码。
但现在,我该如何使用这个应用程序密码访问存储库呢?
URL会是什么?
请有人指导我到一个展示示例的页面吗?
下面是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);
}
更新
前往个人设置,然后前往以下所示的应用程序密码。
githubToken
和https://github.com/
。你实际上想使用哪个系统? - Chris