[HELP]Save From Resource File
Hey ive been look for a code like this for so long
here is a fake code i want u to translate to vb2008
Code:
File.save("C:/Pathway/") from my.resource.MYFILE.exe
please help me out i wanta save a exe file
[SOLVED] {THANKS JMCHILHINNEY!!!!!!! (<----<3 this guy) + Watson123 + minitech
(Add to references)
Dim b() As Byte = My.Resource.myfile 'Name of file in resources
IO.File.WriteAllBytes("location of your file",b)
Re: [HELP]Save From Resource File
My.Resources will return a Byte array. IO.File.WriteAllBytes has a Byte array parameter.
Re: [HELP]Save From Resource File
Quote:
Originally Posted by
jmcilhinney
My.Resources will return a Byte array. IO.File.WriteAllBytes has a Byte array parameter.
well how would i do that?
Re: [HELP]Save From Resource File
Re: [HELP]Save From Resource File
Code:
Dim ipw As New IO.MemoryStream(my.resource.MYFILE.exe)
Dim qyi As IO.FileStream = IO.File.OpenWrite("C:/Pathway/yourfile.exe")
ipw.WriteTo(qyi)
qyi.Close()
Re: [HELP]Save From Resource File
Quote:
Originally Posted by
watson123
Code:
Dim ipw As New IO.MemoryStream(my.resource.MYFILE.exe)
Dim qyi As IO.FileStream = IO.File.OpenWrite("C:/Pathway/yourfile.exe")
ipw.WriteTo(qyi)
qyi.Close()
when i put that it in it cant see the exe file
Re: [HELP]Save From Resource File
Code:
Dim b() As Byte = My.Resource.myfile 'Name of file in resources
IO.File.WriteAllBytes("location of your file",b)
Re: [HELP]Save From Resource File
Quote:
Originally Posted by
minitech
Code:
Dim b() As Byte = My.Resource.myfile 'Name of file in resources
IO.File.WriteAllBytes("location of your file",b)
http://i295.photobucket.com/albums/m...her/help-1.png
http://s295.photobucket.com/albums/m...ent=help-1.png
still didnt work i dont know if ur gettn what im try say so look at that pic please ill so <3 u if u get this 2 work
n yes i tried everything!
Re: [HELP]Save From Resource File
Re: [HELP]Save From Resource File
Oh, we get it alright. Have a look at the Resources page of the project properties. What is listed there? Is that where you added the file as a resource?
Re: [HELP]Save From Resource File
Well, first of all, you don't put the ".exe" there.
Re: [HELP]Save From Resource File
Quote:
Originally Posted by
minitech
Well, first of all, you don't put the ".exe" there.
tried it
Re: [HELP]Save From Resource File
Quote:
Originally Posted by
LoGiCAnti
tried it
I'm yet to see answers to my questions.
Re: [HELP]Save From Resource File
Quote:
Originally Posted by
jmcilhinney
Oh, we get it alright. Have a look at the Resources page of the project properties. What is listed there? Is that where you added the file as a resource?
HEY IT SEE IT NOW <3 so much!!! i guess i couldnt add it to the sidebar thing
Re: [HELP]Save From Resource File
Quote:
Originally Posted by
LoGiCAnti
i guess i couldnt add it to the sidebar thing
If you mean the Solution Explorer then you certainly can add the file there but you then can't access it via My.Resources. My.Resources relates specifically to resources added to the Resources page of the project properties. If you add the file to the Solution Explorer and then set the Build Action to Embedded Resource, a resource is added but you must write some extra code to use a ResourceManager to retrieve the data yourself rather than My.Resources doing it for you.