C# 语言中如何在主函数中调用类Chapter1中的变量adress,急求答案,谢谢~

namespaceProgrammingBlockchain.Chapters{classChapter1{publicvoidLesson1(){Keykey=newK... namespace ProgrammingBlockchain.Chapters
{
class Chapter1
{
public void Lesson1()
{
Key key = new Key(); //generates a new private key.
PubKey pubKey = key.PubKey; //gets the matching public key.
Console.WriteLine("Public Key: {0}", pubKey);
KeyId hash = pubKey.Hash; //gets a hash of the public key.
Console.WriteLine("Hashed public key: {0}", hash);
// 下面语句的adress是在主函数中需要提取的变量
BitcoinAddress address = pubKey.GetAddress(Network.Main); //retrieves the bitcoin address.
Console.WriteLine("Address: {0}", address);
Script scriptPubKeyFromAddress = address.ScriptPubKey;
Console.WriteLine("ScriptPubKey from address: {0}", scriptPubKeyFromAddress);
Script scriptPubKeyFromHash = hash.ScriptPubKey;
Console.WriteLine("ScriptPubKey from hash: {0}", scriptPubKeyFromHash);
}
}
}
展开
 我来答
匿名用户
2016-08-17
展开全部
Chapter1中,没有变量 address ,方法内的,不算 。 。。。。。。。。。。。。。。
追问
那应该怎么改呢?
在Chapter1中加入adress的定义吗?
追答
是否要添加,要看需求逻辑要求的。。。。。。。。
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式