Using IO.File.WriteAllBytes to write from resources. [solved]
Posts 1–6 of 6 · Page 1 of 1
Using IO.File.WriteAllBytes to write from resources. [solved]
I ain't a VB pro but I know a little bit of VB .
I'm trying to use the Resources as my advantage.
I put a .dll in the Resources than I have a button and when I press the button the .dll in the resources should get in that path.
I don't know what I'm doing wrong .
How about actually telling us what the exception message is?
Some general problem solvers:
a) Put an extension (like .dll or whatever) on the file you want to write to.
b) Make sure the directory that you're writing the file to exists before attempting to write there
c) Make sure the parameter is the path of a FILE not a directory.
Access to the path 'C:\SG Interactive\Crossfire Europe' is denied.
The file exists.
Read what I said, IO.File.WriteAllBytes writes to A FILE! Why would you pass a directory as the parameter? If the file doesn't exist already, it will be created and the bytes written to it, otherwise the file will just be truncated before the bytes are written to it.
Would work fine. You have to tell it which FILE to write the bytes to.
Originally Posted by Jason
Read what I said, IO.File.WriteAllBytes writes to A FILE! Why would you pass a directory as the parameter? If the file doesn't exist already, it will be created and the bytes written to it, otherwise the file will just be truncated before the bytes are written to it.