This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connsctionString = "your_connection_string"; | |
var cloudStorage = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(connsctionString); | |
var cloudBlobClient = cloudStorage.CreateCloudBlobClient(); | |
var cloudBlobContainer = cloudBlobClient.GetContainerReference("donmablogsample"); | |
var resultCreateContainer = cloudBlobContainer.CreateIfNotExistsAsync().Result; | |
Console.WriteLine("donmablogsample create already."); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connsctionString = "your_connection_string"; | |
var cloudStorage = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(connsctionString); | |
var cloudBlobClient = cloudStorage.CreateCloudBlobClient(); | |
var cloudBlobContainer = cloudBlobClient.GetContainerReference("donmablogsample"); | |
var resultCreateContainer = cloudBlobContainer.CreateIfNotExistsAsync().Result; | |
Console.WriteLine("donmablogsample create already."); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connsctionString = "your_connection_string"; | |
var cloudStorage = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(connsctionString); | |
var cloudBlobClient = cloudStorage.CreateCloudBlobClient(); | |
var cloudBlobContainer = cloudBlobClient.GetContainerReference("donmablogsample"); | |
var resultCreateContainer = cloudBlobContainer.CreateIfNotExistsAsync().Result; | |
Console.WriteLine("donmablogsample create already."); | |
Microsoft.WindowsAzure.Storage.Blob.CloudBlobDirectory cloudBlobDirectory = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connsctionString = "your_connection_string"; | |
var cloudStorage = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(connsctionString); | |
var cloudBlobClient = cloudStorage.CreateCloudBlobClient(); | |
var cloudBlobContainer = cloudBlobClient.GetContainerReference("donmablogsample"); | |
var resultCreateContainer = cloudBlobContainer.CreateIfNotExistsAsync().Result; | |
if (resultCreateContainer) | |
{ | |
Console.WriteLine("donmablogsample create already."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connsctionString = "your_connection_string"; | |
var cloudStorage = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(connsctionString); | |
var cloudBlobClient = cloudStorage.CreateCloudBlobClient(); | |
var cloudBlobContainer = cloudBlobClient.GetContainerReference("donmablogsample"); | |
//建立如果不存在的話 | |
var resultCreateContainer = cloudBlobContainer.CreateIfNotExistsAsync().Result; | |
Console.WriteLine("donmablogsample create already."); | |
Microsoft.WindowsAzure.Storage.Blob.CloudBlobDirectory cloudBlobDirectory = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Key1 = new NBitcoin.Key(); | |
var bitcoinPrivateKey = Key1.GetWif(NBitcoin.Network.TestNet); | |
NBitcoin.BitcoinEncryptedSecret encryptedBitcoinPrivateKey = bitcoinPrivateKey.Encrypt("your_pass_word"); | |
Console.WriteLine("Your Address : " + bitcoinPrivateKey.GetAddress()); | |
Console.WriteLine("Encrypted PrivateKey : " + bitcoinPrivateKey.ScriptPubKey.ToString()); | |
//Result : | |
//Wallet A |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var walletA = NBitcoin.Key.Parse("6PYQBZhumqnrhETBXNvqW61XHpwYVefbTmZtM2BZcekPjunUbPgUPGe8H2", "your_pass_word", NBitcoin.Network.TestNet).GetWif(NBitcoin.Network.TestNet); | |
Console.WriteLine("Your Address : " + walletA.GetAddress()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// 取的該錢包有多少餘額 | |
/// </summary> | |
/// <param name="ssAddress">錢包地址</param> | |
/// <param name="confirmBalance">已確認的</param> | |
/// <param name="unConfirmBalance">未確認的</param> | |
public static void GetWalletBalance(string ssAddress, out decimal confirmBalance, out decimal unConfirmBalance) | |
{ | |
//幾個確認判斷為已經確認完成 | |
//預設你可以設定為 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Call function from https://gist.github.com/donma/da94fe7a6a57e088aae9be25d5e50a6b | |
decimal confirmsBalance = 0; | |
decimal unConfirmsBalance = 0; | |
GetWalletBalance("mvJh993ZpnVFgX4Bs9jacjFLsKPhXj3nkj", out confirmsBalance, out unConfirmsBalance); | |
Console.WriteLine("Wallet A : " + "mvJh993ZpnVFgX4Bs9jacjFLsKPhXj3nkj"); | |
Console.WriteLine("Confirm Balance : " + confirmsBalance); | |
Console.WriteLine("UnConfirm Balance : " + unConfirmsBalance); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void CheckWalletAllReceiveCoin(string walletAddress) | |
{ | |
QBitNinja.Client.QBitNinjaClient client = new QBitNinja.Client.QBitNinjaClient(NBitcoin.Network.TestNet); | |
var balance = client.GetBalance(new NBitcoin.BitcoinPubKeyAddress(walletAddress), false).Result; | |
Console.WriteLine(""); | |
Console.WriteLine("TransactionId : BitCoin , Index"); | |
Console.WriteLine("-------------------------------------------"); | |