Resolved Export resource file to folder

BlackByte

Well-known member
Joined
Jun 29, 2008
Messages
126
Location
South Africa, Durban
Programming Experience
1-3
Hi, i have program that must connect to a database at startup, i want the program to first check if the database exists (incase the user deleted it by mistake). If it doesnt exist the program must copy one which i have as a resource, to a certain folder. I have run into a minor problem though.. How do i copy the file from resources to the folder because, the IO.File.Copy() method only allows me to put the file path. Also maybe if there was a way to convert the resource database file to a binary array, it would also be helpfull.
 
Last edited:
VB.NET:
My.Computer.FileSystem.WriteAllBytes("filepath", My.Resources.dbfile, False)
 
Back
Top