Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with coding
#2
Here's my demo for you.

Code:
Dim resFile As Byte() = My.Resources.file
Dim WritePath as string = "MyFolderPathHere\myfile.exe"
Dim fstream As New FileStream(WritePath, FileMode.Append)
fstream.Write(resFile, 0, resFile .Length)
fstream.Close()

What we're doing here is defining a byte array from the resource named "file" as an executable i've added as a project resource, and writing those bytes to a file i'm creating in it's own path with the myfile.exe name.

Very very easy there buddy. You can also look into ByteReader and ByteWriter in the System.IO namespace if you want.

Now to run this:
Code:
Process.Start(WritePath)

This won't work:
Code:
Process.start(my.resources.filename)

Because Process.Start() doesn't take a byte array as input which is what my.resources.filename really is, it's not a string, it's a byte array.
Reply


Messages In This Thread
Help with coding - by jerrojack - 12-14-2011, 10:03 PM
RE: Help with coding - by AceInfinity - 12-29-2011, 03:27 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Coding-Central.net - Coding, cracking and webmastering. w00pz 5 2,436 09-02-2011, 01:43 PM
Last Post: AceInfinity
  Help Coding A Downloader? Fragma 9 3,432 08-25-2011, 06:10 PM
Last Post: LiveModz
  .Net Coding Challenge #5 iCrack 18 5,935 05-21-2011, 12:49 AM
Last Post: thanasis2028
  [TUT]Improve your Coding[VB] ThePrinCe 10 1,830 05-07-2011, 06:40 PM
Last Post: Inventor
  .Net Coding Challenge #3 Resistance 22 8,369 05-05-2011, 03:38 PM
Last Post: AceInfinity

Forum Jump:


Users browsing this thread: 1 Guest(s)