使用 Console.ReadLine() C# 读取地址

Read address using Console.ReadLine() C#

我尝试使用以下方法读取内存地址:

int address = Console.ReadLine();

如您所见,这行不通,我该怎么做?

要读取的值:0x007FCB20

首先将其捕获为字符串。例如

string address = Console.ReadLine();

然后将字符串转换为整数:

Int32 addressInt = Convert.ToInt32(address, 16);

他回答了我的问题:https://whosebug.com/users/2864740/user2864740

解决方法:How to set an ints Hex Literal from a string,