|
-
Jun 3rd, 2005, 09:58 AM
#1
Create a File/Registry/Database?
Hi,
How can i create a File/Registry/Database, to Save the time and
playernames?
Thanks,
Sparrow1
-
Jun 3rd, 2005, 10:08 AM
#2
Re: Create a File/Registry/Database?
to give you an answer that would match the level of information you provided in your question I could give an answer like:
"Write a text file with the data in it" or "create a table and save the data"
I doubt either of those answers would help you though.
Can you please explain a little more detail about what it is you are looking to do and then we will be able to provide better answers.
-
Jun 3rd, 2005, 05:44 PM
#3
Re: Create a File/Registry/Database?
A little more explanation about my application.
I made an application with a clock and timer and the purpose of the game
is that the player does it correct and so fast he can!.
What i want to do is saving the results and the playersname?
Only the five or more fasted players shoud have a place in that list!
How should i do that and can you give me an example which code a need?
Thanks,
Sparrow1
-
Jun 4th, 2005, 01:42 AM
#4
Re: Create a File/Registry/Database?
My suggestion would be to keep your results in a SortedList. Each time a player finishes a game you just add their result to the list and then trim it to five items. Because the list is always sorted you don't even have to calculate whether the most recent result belongs in the top five. To save and load your "high scores" each time you serialize and deserialize the SortedList to an XML file. The only issue that may occur is that the key values in a SortedList must be unique, which does not allow two players to have the exact same time. If you use TimeSpan objects, which measure to 100 nanosecond intervals, it is unlikely that two games will have exactly the same time. You could then round to the nearest second for display purposes.
-
May 26th, 2011, 10:39 AM
#5
New Member
Re: Create a File/Registry/Database?
This thread is quite old but:
The answer is: My.Settings.
- How to create a My.Setting:
Open your project in VB and press Project>(Your project name) Properties...>Settings> Write the setting name, type and (If you want) presetted value. - How to access My.Settings in code:
Code:
My.Settings.(Setting Name) = "You control your settings!"
- My.Settings Saves .XML files into \Your username Directory/Users\AppData\(ProgramName)\
-
May 26th, 2011, 10:47 AM
#6
Re: Create a File/Registry/Database?
Answering a question 6 years old with what you believe is the right answer now, may not have even existed that long ago!
Honestly, don't do it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|