How do I copy file from resources to C:\Notes?

  • Thread starter Thread starter Mark B
  • Start date Start date
M

Mark B

How do I programmatically copy SpecialNote.txt from my VB.NET app's project
resources to C:\Notes\ on user's PC at runtime?
 
How do I programmatically copy SpecialNote.txt from my VB.NET app's
project resources to C:\Notes\ on user's PC at runtime?

Why did you ask this here and in the C# group, with a slight modification?
 
Dim myEncoding As New System.Text.ASCIIEncoding()
System.IO.File.WriteAllBytes(myXMLFileLocation,
myEncoding.GetBytes(Properties.Resources.AddinUserSettingsXML))
 
How do I programmatically copy SpecialNote.txt from my VB.NET app's
project resources to C:\Notes\ on user's PC at runtime?

Have you made this directory writeable by /every/ user?
If not, UAC will get in the way on Vista and Windows 7 - directories
outside the user's own hive are usually read-only.

Do you overwrite the file every time your application runs, or only to
first create it?

Why do you need to copy it there anyway?
Do you need to "feed" it to some other program?
If you're only using it within your own code, you can probably find a
way to use the text in the Resource object directly.

HTH,
Phill W.
 
Back
Top