By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,163 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,163 IT Pros & Developers. It's quick & easy.

Saving Text File in registry Key

P: n/a
Hi EveryBody:

Is there any way to save my text file in Registry Key instaed of saving it
in Drive C: or any other drive drive ?

any help will be appreciated

regard's

Husam
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Husam" <Hu***@discussions.microsoft.com> wrote in message news:02**********************************@microsof t.com...
Hi EveryBody:

Is there any way to save my text file in Registry Key instaed of saving it
in Drive C: or any other drive drive ?

any help will be appreciated

regard's

Husam


There probably is, assuming the file is not too large. But, just because you can doesn't mean you should.

Just for grins, why would you want to store text files in the registry?
Nov 21 '05 #2

P: n/a
I would read the text as string, convert it to byte array using
System.Text.Encoding.Default.GetBytes() method and use the SetValue method
of the Microsoft.Win32.RegistryKey object to save it to the registry.

To read the data, use the System.Text.Encoding.Default.GetString() method.

See: http://msdn2.microsoft.com/library/d...us,vs.80).aspx,
http://msdn2.microsoft.com/library/7...us,vs.80).aspx and
http://msdn.microsoft.com/library/de...valuetopic.asp
Shariq
sh****@shariqkhan.com
"Husam" <Hu***@discussions.microsoft.com> wrote in message
news:02**********************************@microsof t.com...
Hi EveryBody:

Is there any way to save my text file in Registry Key instaed of saving it
in Drive C: or any other drive drive ?

any help will be appreciated

regard's

Husam

Nov 21 '05 #3

P: n/a
"Husam" <Hu***@discussions.microsoft.com> schrieb:
Is there any way to save my text file in Registry Key instaed of saving it
in Drive C: or any other drive drive ?


For saving data in the registry, take a look at the
'Microsoft.Win32.Registry' class. Maybe an isolated storage is what you are
looking for (see documentation).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

P: n/a
I wouldn't suggest you save the file in the registry

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.