Hi,
You can read the file in a string array with File.ReadAllLines(yourfilenamehere);.
Then create a class which encapsulates a player.
Create two fields into it: name (string) and points (int or float or whatever numeric type you want).
Make the class implements IComparable
You will now have this method
int CompareTo(object other){
}
Inside it declare a variable of type Player and make the object other of that type (with the as operator)
Then try to compare the istances and return -1 if the other player has to be before (come before in the leaderboard) the player encapsulated by your class, 0 if they have the same place, 1 if the player encapsulated by your class must come before the player represented by other. Hint: compare the points fields with if statements.
You can now convert your string array into a players array with some string tricks (string static class is helpful).
Then sort the array you've found with the method Sort of the array class (I.E. <yourarray>.Sort())
Use the array in whatever method you want.
Make your class override ToString method and write into it:
return this.name + " " + this.points;
Reconvert your array to a string array, or list, by using a foreach loop And the tostring method you created.
If you've chosen to use a list, convert the list to a string array and use File.WriteAllLines(yourstringarray) to rewrite your file.
This is a solution which I think is the most compatible with your code, but there is another:
You can use serialization.
Create a custom list which implements ISerializable class and use it instead of the string array in the upper solution. Use serialization to create streams and the StreamWriter to write the stream, but, as I've understood, those files are already existant and you need to convert them before start using serialization.
Hope this helped.
LG