Copying 2 files from Resources

Jalouly

Newcomer
Joined
Nov 9, 2011
Messages
1
hi all, this is my first post here, i stored 2 files in my application resources in VB.NET and i want to copy these 2 files to a location using a folder dialog i tried this code but it didn't work

Code:
If FolderBrowserDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
            File.Copy(My.Resources.MyFile, FolderBrowserDialog1.SelectedPath)

any code i can try?

Regards.
 
IIRC File.Copy takes a file name as a string and the resource is treated as a stream, you can't just use the two things interchangeably.

You would need to open the resource as a stream and copy the contents to the destination.
 
Back
Top