C#????????????????,????????
???????????? ???????[ 2013/11/12 11:05:55 ] ????????
????//??????? ????????y????á?
public class BookList2 : IBookList
{
private List<string> booklist = new List<string>();
#region IBookList ???
void IBookList.Add(string BookName)
{
booklist.Add(BookName);
}
void IBookList.Append(string BookName)
{
booklist.Insert(booklist.Count?? BookName);
}
void IBookList.Remove(int position)
{
booklist.Remove(position.ToString());
}
int IBookList.Count
{
get
{
return booklist.Count;
}
}
string IBookList.this[int index]
{
get
{
return booklist[index];
}
set
{
booklist[index] = value;
}
}
#endregion
}
class text
{
static void Main()
{
//??????á?
BookList bklist = new BookList();
bklist.Add("?????????");
Console.Write("??????????????:?????{0}"?? bklist[0]);
IBookList ibklist = (IBookList)bklist; //?????????????????????????????????
ibklist.Add("$$$$$???");// ?????????????????
Console.Write("?????????????????y??{0}"?? ibklist[1]);
//??????? ????y????á?
BookList2 bklist2 = new BookList2();
//??????bklist2.Add("???");??????????磺
//??????£?
IBookList Ibk = (IBookList)bklist2;
Ibk.Add("$$$$??????"); //?y??????
Console.Write("??????????????:??y??{0} "?? Ibk[0]);//?y????á?
Console.ReadLine();
}
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11