Click here to Skip to main content
14,693,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
Is their any way to read & write .csv file to the registry using C# winforms? If yes how to do that please help me?
Posted
Comments
   
It has nothing to do with "winforms". You need to embrace separation of concerns.
—SA
BillWoodruff 4-Sep-13 23:34pm
   
Yes, you could (and you have two solutions here that direct you to where you can find out how), but I hope you'll take Sergey's advice, and the caution expressed by OriginalGriff, and NOT do it ! Writing some large bunch of "stuff" into the Registry is the worst possible storage method you could use.

Yes, but I really wouldn't. It is getting harder and harder to access the registry (for good reasons - it was badly abused), and large values (as CSV files tend to be) aren't a good idea at the best of times.

Instead, why not store the file somewhere a bit more normal, and more likely to be backed up? Where should I store my data?[^] makes some suggestions, and it's a lot easier to play with.
If you must store it in the registry, then see here: http://www.c-sharpcorner.com/uploadfile/puranindia/the-windows-registry-in-C-Sharp/[^]
   
Comments
   
5 for providing more reasonable alternatives. Indeed, the registry is already heavily abused, so it's the best to avoid contaminating it even further. :-)
—SA
Member 10240994 5-Sep-13 8:16am
   
Thank you very much for the solution and it is good article.
you are right instead of using registry, I stored in locally and access from there.
OriginalGriff 5-Sep-13 8:21am
   
You're welcome!
All you need is this: http://msdn.microsoft.com/en-us/library/microsoft.win32.registry.aspx[^].

And please see my comment to the question. Please see: http://en.wikipedia.org/wiki/Separation_of_concerns[^].

—SA
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900