[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.
you can make it write to the temp directory with this code
Hope this helps someone
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! '''''''
'''''''''''''''''''''''''''''''''''
Code:
Dim temppath
temppath = If(Environ$("tmp") <> "", Environ$("tmp"), Environ$("temp"))
newFilePath = temppath + "/file.ext"
