在示例中
string newString = Convert.ToBase64String(byte[] array)
我如何转换newString
以获得byte[]
(字节数组)?
答案 0 :(得分:12)
Convert.FromBase64String(newString)
答案 1 :(得分:5)
byte[] data = Convert.FromBase64String(newString);
string decodedString = Encoding.UTF8.GetString(data);
答案 2 :(得分:1)
<html>
<div class="t0"></div>
<div class="t1"></div>
<div class="t2></div>
<div class="t3"></div>
<div class="t4"></div>
</html>
<script>
var holder = ["cretetion", "OgamingSC2", "ESL_SC2", "FreeCodeCamp", "pewdiepie"];
var holderName;
for (var i = 0; i < holder.length; i++) {
holderName = holder[i];
var url = "https://api.twitch.tv/kraken/streams/" + holder[i] + "?callback=?";
$.getJSON(url, function(data) {
var l = ".t" + i;
console.log("Value of l is " + l);
$(l).html("<button class='btn btn-primary'>" +holderName+"</button>");
});
}
</script>