Page 1 of 1

How i can replace a file

Posted: Fri Oct 30, 2009 5:22 pm
by krisis
How i can replace a file whit another file ,whit same name and from my resources folder
please Help!!!

Re: How i can replace a file

Posted: Fri Oct 30, 2009 5:51 pm
by CodenStuff
Hello,

Once youve added your file to resources make sure that in your code you import:
Code: Select all
Imports System.IO
Then inside a "Button_Click" event or however your going to extract the file add this code:
Code: Select all
File.WriteAllBytes("C:\NameOfFile.ext", My.Resources.NameOfResourceFile)
And thats it cooll;

Re: How i can replace a file

Posted: Fri Oct 30, 2009 6:46 pm
by krisis
thx you are the best
i love codenstuff.com