“string”并不包含对“ToInt32”的定义
Microsoft (R) Visual C# .NET 编译器版本 7.10.6001.4
用于 Microsoft (R) .NET Framework 版本 1.1.4322
版权所有 (C) Microsoft Corporation 2001-2002。保留所有权利。
SiteManager.cs(92,7): error CS0117: “string”并不包含对“ToInt32”的定义
SiteManager.cs(94,18): error CS0117: “string”并不包含对“ToInt32”的定义
Code 如下
private void DeleteSite()
{
string choice;
do
{
Console.WriteLine("\nDeletion Menu\n");
DisplayShortList();
Console.Write("\nPlease select an item to delete:");
choice = Console.ReadLine();
if(choice == "Q" || choice == "q")
{
break;
}
if(choice.ToInt32() <= sites.NextIndex)
{
sites.Remove(choice.ToInt32()-1);
}
}while(true);
}
问题点数:10、回复次数:2Top
1 楼dahuzizyd(你就是我心中的女神)回复于 2005-10-18 21:47:17 得分 10
用Convert.ToInto32(choice)Top
2 楼adow(adow)回复于 2005-10-18 21:48:32 得分 0
用Int32.Parse或者Convert.ToInt32()Top




