Replace first parameter with the name of the file you want it to be saved into and replace the second parameter with the name of your resource.Code:My.Computer.FileSystem.WriteAllBytes("C:\Filename.extension",My.Resources.MyResourceName,False)
Hi mpgh!
I would like to know how to extract some files in the disk C:\ , previously uploaded in the resources of the program.
(Sorry for my bad english, i dont know some words then i use google translater and it's not really good...)
Pls help me!
Press Rep if you like my programs and my helps
Replace first parameter with the name of the file you want it to be saved into and replace the second parameter with the name of your resource.Code:My.Computer.FileSystem.WriteAllBytes("C:\Filename.extension",My.Resources.MyResourceName,False)
Thanks, i test it.
---------- Post added at 11:58 PM ---------- Previous post was at 11:42 PM ----------
Thanks, it's working!!
Problem solved.
---------- Post added 07-06-2012 at 12:11 AM ---------- Previous post was 07-05-2012 at 11:58 PM ----------
Can you add me on skype? I'm RevengeHelroos
Press Rep if you like my programs and my helps
Shouldn't you check first if the file exists before you eventually replace it?
Code:If My.Computer.FileSystem.FileExists("C:\Filename.extension") Then MsgBox("File exists") Else Dim myFile As Object = My.Resources.Filename IO.File.WriteAllBytes("C:\Filename.extension", myFile) End If
No, because i have to delete all files and then replace these.
---------- Post added at 12:56 PM ---------- Previous post was at 12:10 PM ----------
I need it for a cleaner and for a installer, but thanks for 2nd version of the code!
Press Rep if you like my programs and my helps