Post: VB.NET Using a Binary File as a resource
10-29-2013, 01:53 PM #1
Default Avatar
Oneup
Guest
(adsbygoogle = window.adsbygoogle || []).push({}); This was something I used in order to try and keep my programs down to 1 file. Instead of including a seperate file that handled the updating, I simply embedded it into the main program. To do this all I did was make it a resource and when I needed to use it I would write it out to the root directory that the program was in.

To add a file as a resource, right click your project and click properties.
You must login or register to view this content.

Click on the Resources tab. On the top click on strings and select files. Drag and drop the file you want to include as the resource into this window.

You must login or register to view this content.
Click save or save all.

Now when you decide you need to use that file you can write it out to a directory then run it.

           
IO.File.WriteAllBytes("./" & "Updater.exe", My.Resources.Updater)
Process.Start("Updater.exe")

The following user thanked Oneup for this useful post:

Dan

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo