storing a binary file in a variable 
Author Message
 storing a binary file in a variable

Hi,

I need help storing the bytes of a binary file in a variable.  The file
is located on the filesystem.

For example, let's say I have a file "c:\vb\somefile.bmp".  How can I
store this file in a variable.

Thanks,
Dave



Mon, 04 Jun 2001 03:00:00 GMT  
 storing a binary file in a variable

Quote:

>Hi,

>I need help storing the bytes of a binary file in a variable.  The file
>is located on the filesystem.

>For example, let's say I have a file "c:\vb\somefile.bmp".  How can I
>store this file in a variable.

    Dim sBytes As String, fh As Integer
    fh = FreeFile
    Open "c:\vb\somefile.bmp" For Binary As #fh
    sBytes = Space$(LOF(fh))
    Get #fh, , sBytes
    Close #fh

Lee Weiner
weiner AT fuse DOT net



Tue, 05 Jun 2001 03:00:00 GMT  
 storing a binary file in a variable
Or, if you've got VB 5 or above, you can use a Byte Array instead of a
string (it will then be easier to maniplate or check the data).

Mike

Quote:


>>Hi,

>>I need help storing the bytes of a binary file in a variable.  The file
>>is located on the filesystem.

>>For example, let's say I have a file "c:\vb\somefile.bmp".  How can I
>>store this file in a variable.

>    Dim sBytes As String, fh As Integer
>    fh = FreeFile
>    Open "c:\vb\somefile.bmp" For Binary As #fh
>    sBytes = Space$(LOF(fh))
>    Get #fh, , sBytes
>    Close #fh

>Lee Weiner
>weiner AT fuse DOT net



Wed, 06 Jun 2001 03:00:00 GMT  
 storing a binary file in a variable

Quote:

> Or, if you've got VB 5 or above, you can use a Byte Array instead of a
> string (it will then be easier to maniplate or check the data).

> Mike

How do I use a byte array?


Thu, 07 Jun 2001 03:00:00 GMT  
 storing a binary file in a variable
Jan VBPJ has a great article on it!

Quote:


>> Or, if you've got VB 5 or above, you can use a Byte Array instead of a
>> string (it will then be easier to maniplate or check the data).

>> Mike

>How do I use a byte array?

--------------------------------------------
Remove ALL the zz's to repoond:




Thu, 07 Jun 2001 03:00:00 GMT  
 storing a binary file in a variable
Oops. it;s in the article Creating Persistant Collections

Quote:


>> Or, if you've got VB 5 or above, you can use a Byte Array instead of a
>> string (it will then be easier to maniplate or check the data).

>> Mike

>How do I use a byte array?

--------------------------------------------
Remove ALL the zz's to repoond:




Thu, 07 Jun 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Reading in a binary file and storing in a variable

2. Reading in a binary file and storing in a variable

3. Storing and Retrieving a Binary file from a .res file

4. Storing binary file in drawing

5. Reading a binary file and storing as a string

6. Storing binary files (JPGs) in an Access 7 database using VB4

7. Storing Binary files into MS-SQL via VB3

8. Storing Binary files in Access Database

9. Storing user types in a binary file?

10. Storing binary files in a database

11. Storing binary file data in a Jet memo field

12. Storing Binary Files in a Database Field ?

 

 
Powered by phpBB® Forum Software