c# - How to read by streamreader and sort -


i'm making passaparola game , @ end of game save nickname , score stream writer nickname;score

i'm trying make leaderboard dont know how sort them highest lowest @ or after saving.

also display them on labels wrote ;

        string[] scorearray;         string sc = sr.readline();          scorearray = sc.split(';');         label2.text = scorearray[0];         label3.text = scorearray[1]; 

which writes first line in text file.anyway how can sort , write them in labels ?

sort array , use foreach loop display results:

string[] scorearray; string sc = sr.readline(); scorearray = sc.split(';'); array.sort(scorearray); foreach (string s in scorearray) {     //your code here. } 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -