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.PHP Code:
Dim b As Byte() = My.Resources. Your resource name
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.PHP Code:
Dim FilePath As String = Application.StartupPath & "\The file name & extension you want"
This creates a temp file at the file path you specified. Which will allow us to right the bytes to it.PHP Code:
Dim TempFile As System.IO.FileStream = IO.File.Create(FilePath)
That is the main part of the program... It writes the bytes from your resource, to your tempfile. So it will actually work.PHP Code:
TempFile.Write(b, 0, b.Length)
That closes the temporary file thus finalizing the byte writingPHP Code:
TempFile.Close()
Enjoy
Results 1 to 2 of 2
Thread: [Vb.net] Droppping a resource.
- 27 Feb. 2010 08:07pm #1
[Vb.net] Droppping a resource.
- 27 Feb. 2010 10:17pm #2
So this can make a specific size program?
Im confused on how to use thisSignature By Eternal Darkness
Respect List :
BooBearsh
iLuvMuffinsx3
Sk8er
RobbyTheReaper
Eternal Darkness
Love List :
Elirocks - Luv Ya
MartinLG - idk here just wanted to be there lol
Jdawg - Sweet Guy