29 Haziran 2012 Cuma

how to write content of dictionary to file

In order to write the content of a dictionary to a file:


        public static void writeDictToFile(Dictionary dict, string filename) {
            File.WriteAllLines(filename + ".txt",
            dict.Select(x => "[" + x.Key + " " + x.Value + "]").ToArray());
        }

http://stackoverflow.com/questions/3067282/how-to-write-the-content-of-a-dictionary-to-a-text-file

Hiç yorum yok:

Yorum Gönder