3
访问到位桶作为解释here如何使用我创建一个应用程序密码应用密码
但现在,我该如何访问使用这个应用程序的密码库?
什么是网址?
有人可以指示我一个页面显示一个例子吗?
以下是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);
}
你能发表一些解释吗? – inye
@inye在问题中增加了一些细节 – VivekDev
您询问了关于Bitbucket的问题,但您的代码引用了'githubToken'和'https:// github.com /'。你真的想用哪个系统? – Chris