| View previous topic :: View next topic |
| Author |
Message |
Exodias Expert Cheater
Reputation: 0
Joined: 14 May 2008 Posts: 220
|
Posted: Sat Feb 07, 2009 3:07 pm Post subject: Need An VB Expert |
|
|
Im just making an organizer for my big *** folder
But there are some things I cant figure out to do
I want to add the file into the program and use a button or something else to open it
like embedding the file into the program
if you can help add me on AIM or PM me here
TheAzn619 = AIM
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sat Feb 07, 2009 4:11 pm Post subject: |
|
|
Well... If you want to embed a file into a program you can do this:
Add an array of bytes to the end of a program that you know the program does not have anywhere else.
Ex. 00 7A E5 FF D3 AD DE C0 AD DE
Then add the file size in a 4 byte after it.
Ex 04 00 00 00
Then add the contents after it.
To read the file just open a IO to the program file then Scan for the AoB. Then read the 4 byte after then take the contents.
Im not sure if this is what you want but it is how I store files in a exe then loading at runtime.
|
|
| Back to top |
|
 |
Exodias Expert Cheater
Reputation: 0
Joined: 14 May 2008 Posts: 220
|
Posted: Sat Feb 07, 2009 4:28 pm Post subject: |
|
|
What?.........
do you have AIM or msn or something
|
|
| Back to top |
|
 |
Odecey Master Cheater
Reputation: 1
Joined: 19 Apr 2007 Posts: 259 Location: Scandinavia
|
Posted: Sat Feb 07, 2009 5:42 pm Post subject: |
|
|
To embed a file into a program with visual studio, do the following:
1. Go to your solution explorer, right click on your project and from the
dropdown menu click on "Add->Existing item", then browse to the file and click "Add".
2. In the solution explorer there should be a new file. Right click on it, and select "Properties". A new window showing the properties of the file should show up.
3. Under the "Build action" property, select "Embedded resource".
The next time you compile the file you selected should be embedded in the executable.
I'm not sure how you access the file in VB, but in C# it's: | Code: | | Stream s = this.GetType().Assembly.GetManifestResourceStream("NameSpace.FileName.Extension"); | . If i recall correctly, the file will be read-only.
Edit: Forgot something.
_________________
Never confuse activity with productivity. You can be busy without a purpose, but what's the point?- Rick Warren |
|
| Back to top |
|
 |
Exodias Expert Cheater
Reputation: 0
Joined: 14 May 2008 Posts: 220
|
Posted: Sat Feb 07, 2009 6:26 pm Post subject: |
|
|
Oh, Well I add it as resource
Now all I need to do is find the command so That I could access the file
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
|
| Back to top |
|
 |
Odecey Master Cheater
Reputation: 1
Joined: 19 Apr 2007 Posts: 259 Location: Scandinavia
|
Posted: Sun Feb 08, 2009 1:41 am Post subject: |
|
|
I told him to do it that way because I thought he wanted to embed them, instead of having them floating around in the same folder as the executable. Sorry If I misinterpreted.
_________________
Never confuse activity with productivity. You can be busy without a purpose, but what's the point?- Rick Warren |
|
| Back to top |
|
 |
|