* Ich verstehe, dass ich einen Inhalt Array-String brauche, aber ich habe Probleme bei der Umsetzung.Ich habe Probleme mit File.WriteAllLines in C#
Dictionary<string, string> dictionary = new Dictionary<string, string>();
string[] array = File.WriteAllLines("settings.cfg");
for (int i = 0; i < array.Length; i++)
{
string text = array[i];
if (!text.StartsWith("/") && text.Contains(":"))
{
string[] array2 = text.Split(new char[]
{
':'
});
dictionary.Add(array2[0], array2[1]);
}
}
* Wie würden Sie string[]
Inhalt implementieren?
Sie geben 'WriteAlllines' keine Zeilen. – Brandon
Vielleicht möchten Sie 'File.ReadAllLines' anstelle von' File.WriteAllLines'? –
Ich habe versucht, diesen Code 'File.WriteAllLines' im Verzeichnis und so –