|
-
Apr 22nd, 2010, 12:54 AM
#1
Thread Starter
Lively Member
[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)
Last edited by LoGiCAnti; Apr 22nd, 2010 at 09:41 PM.
Reason: solved
-
Apr 22nd, 2010, 01:01 AM
#2
Re: [HELP]Save From Resource File
My.Resources will return a Byte array. IO.File.WriteAllBytes has a Byte array parameter.
-
Apr 22nd, 2010, 01:07 AM
#3
Thread Starter
Lively Member
Re: [HELP]Save From Resource File
 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?
-
Apr 22nd, 2010, 09:16 AM
#4
Thread Starter
Lively Member
Re: [HELP]Save From Resource File
-
Apr 22nd, 2010, 09:38 AM
#5
Lively Member
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()
-
Apr 22nd, 2010, 05:20 PM
#6
Thread Starter
Lively Member
Re: [HELP]Save From Resource File
 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
-
Apr 22nd, 2010, 05:42 PM
#7
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)
-
Apr 22nd, 2010, 05:57 PM
#8
Thread Starter
Lively Member
Re: [HELP]Save From Resource File
 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://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!
Last edited by LoGiCAnti; Apr 22nd, 2010 at 05:58 PM.
Reason: rong img source
-
Apr 22nd, 2010, 06:52 PM
#9
Thread Starter
Lively Member
Re: [HELP]Save From Resource File
-
Apr 22nd, 2010, 06:54 PM
#10
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?
-
Apr 22nd, 2010, 07:11 PM
#11
Re: [HELP]Save From Resource File
Well, first of all, you don't put the ".exe" there.
-
Apr 22nd, 2010, 09:22 PM
#12
Thread Starter
Lively Member
Re: [HELP]Save From Resource File
 Originally Posted by minitech
Well, first of all, you don't put the ".exe" there.
tried it
-
Apr 22nd, 2010, 09:30 PM
#13
Re: [HELP]Save From Resource File
 Originally Posted by LoGiCAnti
tried it
I'm yet to see answers to my questions.
-
Apr 22nd, 2010, 09:36 PM
#14
Thread Starter
Lively Member
Re: [HELP]Save From Resource File
 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
-
Apr 22nd, 2010, 09:54 PM
#15
Re: [HELP]Save From Resource File
 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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|