[Vb.net] Droppping a resource.
In this tutorial i will show you how to drop a resource when you click a button.
First.. Add the resource to the project you would like to later drop.
Put a button on the form.
Now comes the coding.
What this does is dims b, as a byte, from the resource you specified.
Then i want you to add this
That dims a file path as the application startup path and the name you want. Thus leading us to the next step.
This creates a temp file at the file path you specified. Which will allow us to right the bytes to it.
That is the main part of the program... It writes the bytes from your resource, to your tempfile. So it will actually work.
That closes the temporary file thus finalizing the byte writing
Enjoy
First.. Add the resource to the project you would like to later drop.
Put a button on the form.
Now comes the coding.
Dim b As Byte() = My.Resources. Your resource nameWhat this does is dims b, as a byte, from the resource you specified.
Then i want you to add this
Dim FilePath As String = Application.StartupPath & "\The file name & extension you want"
That dims a file path as the application startup path and the name you want. Thus leading us to the next step.
Dim TempFile As System.IO.FileStream = IO.File.Create(FilePath)
This creates a temp file at the file path you specified. Which will allow us to right the bytes to it.
TempFile.Write(b, 0, b.Length)That is the main part of the program... It writes the bytes from your resource, to your tempfile. So it will actually work.
TempFile.Close() That closes the temporary file thus finalizing the byte writing

Enjoy
