|
I've actually written a program - I'll post it later, but right now, I'm having difficultly with this problem: storing a high sore list. I'd prefer a cross-platform (should be generic enough to also work on Mono) way to store the scores and some other variables in a text file, and easily read, parse into a ListView/DataGridView and write.
I don't want to use SQL Server or Access, as they are overkill for my needs.
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)
|
|
|
|
|
|
a simple text file could do; maybe a CSV; maybe XML.
if sharing amongst multiple users is important, be careful about concurrent accesses.
|
|
|
|
|
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)
|
|
|
|
|
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 wrote: string.Split(',') make reading a CSV quite easy
Not if the CSV has commas in the values, e.g. ...,"Pattyn, Luc",...
|
|
|
|
|
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.
|
|
|
|
|
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.
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.
|
|
|
|
|
PIEBALDconsult wrote: I think I'll post that on my wall.
Why, it isn't there yet?
|
|
|
|
|
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)
|
|
|
|
|
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
|
|
|
|
|
Nice find - I'll be checking this one out myself
DaveIf 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)
|
|
|
|
|
hi
brother
i search from someone who can make small program for me
if u can tell me
f0f020002000@yahoo.com
|
|
|
|
|
|
Hi
I am looking to read my Program's process memory. So I dump with taskmanager in *.dmp and but I don't know how to read in my own Visual C# program.
My task is to search into memory of program to find the strings
So i am looking open dump file similiar to "WinHex" program and then search into strings.
Regards
Simran
|
|
|
|
|
Pick one forum and stick with it. Posting to multiple forums will just get you ignored
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi
i search from programmer
thank you
|
|
|
|
|
I have a Windows Service written in c# that run on LocalSystem Account, and i need to check if in a network shared folder of a Server in my network exist a file...
With a File.Exist() method i can't do it because i haven't permission with LocalSystem account .
Is there a way to access to a network share with c# Service with LocalSystem Account ?
Is there some windows API that allow to do that ?
Thanks.
|
|
|
|
|
You service cannot run under the Local System account if you want to use network resources that require authentication, such as Shares. You service must run under an account setup for access to the share.
|
|
|
|
|
And what about impersonation? Do you think that would fail with a service?
|
|
|
|
|
Honestly, what's the difference? Either way, you're still using an account that has access to the network resource. I fail to see the point of going through the hassle of impersonation when you can just run the service as the same user.
|
|
|
|
|
when i m accessing database from my Default.aspx page exception raises i:e
Cannot open database "MyDatabase" requested by the login. The login failed. Login failed for user '[Computer Name/ASPNET]'.
any idea how to solve this?
|
|
|
|
|
Couple of options:
-Add the asp.net user account as a login to the Database Server (not very secure, probalby a bad option)
-Connect to the database using a connection string that uses a login account already configured on the database server.
|
|
|
|
|
and how to configure user to databse server?
i am using SQL Express 2005
my connection string is
string connString = @"server = .\sqlexpress; integrated security = true; database = MyDatabase";
|
|
|
|
|
Change your connection string to something like that, must make sure the user id is a user configured on the server and specify its password.
Data Source=.\sqlexpress;integrated security = true;database =MyDatabase;User Id=myUsername;Password=myPassword;
|
|
|
|