????C#?б?????????????????????
????1.???????
//???????????Sample????????????
foreach (string sp in Enum.GetNames(typeof(Sample)))
{
ary.Add(sp);
}
//???????????Sample?????????
foreach (string sp in Enum.GetValues(typeof(Sample)))
{
ary.Add(sp);
}
????2.????ArrayList(Queue??Stack)
??????????string????????ArrayList?е??????????κ????????????????????ArrayList?е??????????????????
//????????string????????
foreach (string text in arraylist)
{
ary.Add(text);
}
???????????Queue???к?Stack?????????ArrayList????????? ?????????foreach?????????????????????????????????????????????
????3.Winform?????е???
//??????????????е???????????????????????????????
foreach (Control ctl in this.Controls)
{
//??????ж??????????????
if (ctl.GetType().Name.Equals("ListBox") || ctl.Name.Equals("listBox1"))
this.Controls.Remove(ctl);
}
????4.HashTable?????
DictionaryEntry?????????System.Collections
//??????????????е?????
foreach (DictionaryEntry item in hashTable)
{
ary.Add("???????"+item.Key+"????????"+item.Value.ToString());
}
?????????????????????????е???????