为什么我在 c# TelegramBotSharp 中使用 Bot.Me.FirstName 时出错?
Why i get error when use Bot.Me.FirstName in c# TelegramBotSharp?
我是 Telegram 机器人的新手并编写了这个简单的代码:
Bot = new TelegramBot("305316106:AAGnCZeZtoc3FtzuyGbmB2B0yJ2dtZxua0M");
Console.WriteLine("Hi , My name is :{0} , ANd My ID is :{1}",Bot.Me.FirstName);
Console.ReadKey();
但是当我运行那个代码时我得到这个错误
Index (zero based) must be greater than or equal to zero and less than
the size of the argument list.
发生什么事了?我怎么解决这个问题?谢谢
Console.WriteLine
需要第二个参数(您提供的格式有两个占位符):
Console.WriteLine("Hi , My name is :{0} , ANd My ID is :{1}", Bot.Me.FirstName, Bot.Me.Id);
我是 Telegram 机器人的新手并编写了这个简单的代码:
Bot = new TelegramBot("305316106:AAGnCZeZtoc3FtzuyGbmB2B0yJ2dtZxua0M");
Console.WriteLine("Hi , My name is :{0} , ANd My ID is :{1}",Bot.Me.FirstName);
Console.ReadKey();
但是当我运行那个代码时我得到这个错误
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
发生什么事了?我怎么解决这个问题?谢谢
Console.WriteLine
需要第二个参数(您提供的格式有两个占位符):
Console.WriteLine("Hi , My name is :{0} , ANd My ID is :{1}", Bot.Me.FirstName, Bot.Me.Id);