Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Storing a high score list

Storing a high score list

Scheduled Pinned Locked Moved C#
databasesql-serversysadminhelp
14 Posts 7 Posters 17 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Luc Pattyn

    a simple text file could do; maybe a CSV; maybe XML. if sharing amongst multiple users is important, be careful about concurrent accesses. :)

    Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


    Getting an article published on CodeProject now is hard and not sufficiently rewarded.


    T Offline
    T Offline
    The Cake of Deceit
    wrote on last edited by
    #4

    I'm not too worried about sharing - it's all in the user's home directory (my excess Linux use is reflecting off Windows, wow) and I'd like a nice simple two-way wrapper. If I can read it with foreach, it shouldn't be too hard to add the items into a ListView... BTW, CP seems to randomly barf XML errors after loading various pages, so if you see a double post, not my fault.

    People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. - Calvin (from Calvin and Hobbes)(The Indispensable Calvin and Hobbes, p105-3)

    L N F 3 Replies Last reply
    0
    • T The Cake of Deceit

      I'm not too worried about sharing - it's all in the user's home directory (my excess Linux use is reflecting off Windows, wow) and I'd like a nice simple two-way wrapper. If I can read it with foreach, it shouldn't be too hard to add the items into a ListView... BTW, CP seems to randomly barf XML errors after loading various pages, so if you see a double post, not my fault.

      People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. - Calvin (from Calvin and Hobbes)(The Indispensable Calvin and Hobbes, p105-3)

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #5

      File.ReadAllLines() and string.Split(',') make reading a CSV quite easy. XML is an alternative, easy once you know your way around in the Xml classes. Serialization is also a possibility.

      The Cake of Deceit wrote:

      CP seems to randomly barf XML errors

      never seen that myself. you might bring it up in the suggestions forum, best with URL of pages that (sometimes) do it, plus details on your OS and browser. :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


      Getting an article published on CodeProject now is hard and not sufficiently rewarded.


      P T 2 Replies Last reply
      0
      • T The Cake of Deceit

        I'm not too worried about sharing - it's all in the user's home directory (my excess Linux use is reflecting off Windows, wow) and I'd like a nice simple two-way wrapper. If I can read it with foreach, it shouldn't be too hard to add the items into a ListView... BTW, CP seems to randomly barf XML errors after loading various pages, so if you see a double post, not my fault.

        People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. - Calvin (from Calvin and Hobbes)(The Indispensable Calvin and Hobbes, p105-3)

        N Offline
        N Offline
        Not Active
        wrote on last edited by
        #6

        FileHelpers[^] is an excellent library for working with various file formats. Check out the home page[^]


        I know the language. I've read a book. - _Madmatt

        D 1 Reply Last reply
        0
        • N Not Active

          FileHelpers[^] is an excellent library for working with various file formats. Check out the home page[^]


          I know the language. I've read a book. - _Madmatt

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #7

          Nice find - I'll be checking this one out myself :thumbsup:

          Dave

          If this helped, please vote & accept answer!

          Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
          BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

          1 Reply Last reply
          0
          • L Luc Pattyn

            File.ReadAllLines() and string.Split(',') make reading a CSV quite easy. XML is an alternative, easy once you know your way around in the Xml classes. Serialization is also a possibility.

            The Cake of Deceit wrote:

            CP seems to randomly barf XML errors

            never seen that myself. you might bring it up in the suggestions forum, best with URL of pages that (sometimes) do it, plus details on your OS and browser. :)

            Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


            Getting an article published on CodeProject now is hard and not sufficiently rewarded.


            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #8

            Luc Pattyn wrote:

            string.Split(',') make reading a CSV quite easy

            Not if the CSV has commas in the values, e.g. ...,"Pattyn, Luc",...

            L 1 Reply Last reply
            0
            • P PIEBALDconsult

              Luc Pattyn wrote:

              string.Split(',') make reading a CSV quite easy

              Not if the CSV has commas in the values, e.g. ...,"Pattyn, Luc",...

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #9

              I would never do that. That deserves two fields. When I use CSV, I choose my comma carefully; and when in doubt I remove it from the data fields when storing! In general, you're right of course. :)

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


              Getting an article published on CodeProject now is hard and not sufficiently rewarded.


              P 1 Reply Last reply
              0
              • L Luc Pattyn

                I would never do that. That deserves two fields. When I use CSV, I choose my comma carefully; and when in doubt I remove it from the data fields when storing! In general, you're right of course. :)

                Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                Getting an article published on CodeProject now is hard and not sufficiently rewarded.


                P Offline
                P Offline
                PIEBALDconsult
                wrote on last edited by
                #10

                Well, book or movie titles that include commas.

                Luc Pattyn wrote:

                I choose my comma carefully

                Yes, one should never use a comma as a comma. :-D I've known people to only use Caret (^) as the delimiter because it's unlikely to be in the data. I just prefer to put quotes around string values just because.

                Luc Pattyn wrote:

                In general, you're right of course.

                I think I'll post that on my wall.

                L 1 Reply Last reply
                0
                • P PIEBALDconsult

                  Well, book or movie titles that include commas.

                  Luc Pattyn wrote:

                  I choose my comma carefully

                  Yes, one should never use a comma as a comma. :-D I've known people to only use Caret (^) as the delimiter because it's unlikely to be in the data. I just prefer to put quotes around string values just because.

                  Luc Pattyn wrote:

                  In general, you're right of course.

                  I think I'll post that on my wall.

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #11

                  PIEBALDconsult wrote:

                  I think I'll post that on my wall.

                  Why, it isn't there yet? :laugh:

                  Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                  Getting an article published on CodeProject now is hard and not sufficiently rewarded.


                  1 Reply Last reply
                  0
                  • T The Cake of Deceit

                    I'm not too worried about sharing - it's all in the user's home directory (my excess Linux use is reflecting off Windows, wow) and I'd like a nice simple two-way wrapper. If I can read it with foreach, it shouldn't be too hard to add the items into a ListView... BTW, CP seems to randomly barf XML errors after loading various pages, so if you see a double post, not my fault.

                    People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. - Calvin (from Calvin and Hobbes)(The Indispensable Calvin and Hobbes, p105-3)

                    F Offline
                    F Offline
                    fuad_2000
                    wrote on last edited by
                    #12

                    hi brother i search from someone who can make small program for me if u can tell me f0f020002000@yahoo.com

                    C 1 Reply Last reply
                    0
                    • F fuad_2000

                      hi brother i search from someone who can make small program for me if u can tell me f0f020002000@yahoo.com

                      C Offline
                      C Offline
                      Calla
                      wrote on last edited by
                      #13

                      www.rentacoder.com[^]

                      1 Reply Last reply
                      0
                      • L Luc Pattyn

                        File.ReadAllLines() and string.Split(',') make reading a CSV quite easy. XML is an alternative, easy once you know your way around in the Xml classes. Serialization is also a possibility.

                        The Cake of Deceit wrote:

                        CP seems to randomly barf XML errors

                        never seen that myself. you might bring it up in the suggestions forum, best with URL of pages that (sometimes) do it, plus details on your OS and browser. :)

                        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                        Getting an article published on CodeProject now is hard and not sufficiently rewarded.


                        T Offline
                        T Offline
                        The Cake of Deceit
                        wrote on last edited by
                        #14

                        I'm dumbfrazzled myself. I just have two columns in the list view, and want to at least read the CSV and parse it in. I don't need to transform LV's into CSVs, as I write to the CSV. All I ask is for a simple way to read and write CSVs, with an easy to to add the CSV items into a list view. Nothing to complicated, just an int and string in two columns. If there are missing Cs, my keyboard's C key isn't very responsible, sorry about that.

                        People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. - Calvin (from Calvin and Hobbes)(The Indispensable Calvin and Hobbes, p105-3)

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups