• Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

VB.NET Using a Binary File as a resource

1UP

Member
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 up******, 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.
resource1.png


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.

resource2.png

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.

Code:
IO.File.WriteAllBytes("./" & "Updater.exe", My.Resources.Updater)
Process.Start("Updater.exe")
 
General chit-chat
Help Users
      @ QM|T_JinX: couldnt get on cc for 2 days or so not sure why
      Back
      Top