How can i open a exe file in my resoure
I have a exe file in my resoure. How can i open it.(execute it)?
Re: How can i open a exe file in my resoure
Code:
Dim path As String = Application.StartupPath & "\temp.exe"
IO.File.WriteAllBytes(path, My.Resources.TheResourceFile)
Process.Start(path)
and then just delete the file when you're finished executing it (if you want)
Re: How can i open a exe file in my resoure
Quote:
Originally Posted by
Philly0494
Code:
Dim path As String = Application.StartupPath & "\temp.exe"
IO.File.WriteAllBytes(path, My.Resources.TheResourceFile)
Process.Start(path)
and then just delete the file when you're finished executing it (if you want)
Thanks, i tried your way but it may be quite slowly,i thinks the reason is "writeallbytes" to new path , is there other way more quickly open that exe file ?
Re: How can i open a exe file in my resoure
Write it to a MemoryStream instead...beware that if the size of the executable exceeds available memory, it might not be a nice idea after all. -.-
Re: How can i open a exe file in my resoure
Quote:
Originally Posted by
garyjohn_2000
Write it to a
MemoryStream instead...beware that if the size of the executable exceeds available memory, it might not be a nice idea after all. -.-
I'm curious to see how this would be done, does anybody have an example of someone launching an executable into memory without writing it to its own file first?