我有我的字典裏這個工作代碼:C#隨機進入點擊
dict = new Dictionary<string, string>();
using (StreamReader read = new StreamReader("dictionaryfile.csv"))
{
string line;
while ((line = read.ReadLine()) != null)
{
string[] splitword = line.Split(',');
dict.Add(splitword[0], splitword[1]);
}
}
我添加了一個按鈕,我的Windows窗體,我將如何分配從我的字典裏隨機進入在點擊按鈕的消息框中顯示?
...沒什麼,我不知道該怎麼做,這就是爲什麼我要求幫助如何做到這一點 – user1353517
你是否認真地告訴我,你甚至沒有谷歌「隨機c#」? – Oded
是否有任何理由不與字典同時添加條目到List>? –