[SOURCE CODE]Write File To Disk From Resources[VB.NET]
Posts 1–3 of 3 · Page 1 of 1
[SOURCE CODE]Write File To Disk From Resources[VB.NET]
Just add your file to the resources of the project and declare the resource in your variables.
Code:
'''''''''''''''''''''''''''''''''''
'''''''Declare variables ''''''
'''''''''''''''''''''''''''''''''''
Dim newFilePath As String
Dim resource As Array
'''''''''''''''''''''''''''''''''''
'''''''Put data in variables'''''''
'''''''''''''''''''''''''''''''''''
newFilePath = "C:/test/test.ext" 'your file path (string)
resource = My.Resources.something ' resouce=YOUR RESOURCE my.resources.something
'''''''''''''''''''''''''''''''''''
'''''''Write file '''''''
'''''''''''''''''''''''''''''''''''
Using sCreateFile As New IO.FileStream(newFilePath, IO.FileMode.Create)
sCreateFile.Write(resource, 0, resource.Length)
End Using
'''''''''''''''''''''''''''''''''''
'''''''DONE! '''''''
'''''''''''''''''''''''''''''''''''
you can make it write to the temp directory with this code