Wie Fehler zu vermeiden, wenn Schlüssel null ist?Wie vermeidet man Nullschlüsselfehler im Wörterbuch?
//Getter/setter
public static Dictionary<string, string> Dictionary
{
get { return Global.dictionary; }
set { Global.dictionary = value; }
}
UPDATE:
Dictionary.Add("Key1", "Text1");
Dictionary["Key2"] <-error! so what can I write in the GET to avoid error?
Dank.
grüße
Der Code die Frage nicht passt ... Wo ist Ihr Schlüssel? –