| | |
Reading/Writing Binary Files
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2008
Posts: 13
Reputation:
Solved Threads: 0
Ok Well, in vb6 it's completely easy.
For an example, im trying to convert this to vb.net but im kinda struggling.
For Example, i don't know what the new get and put statements are in vb.net.
And in my view of conversion is
NOTE: THen of course i forgot to add the put statements so the bytes and data would be able to be written into the file. I forgot to add it, and too lazy to add it -.-'. So if anyone knows how i can use the "put" statements in vb.net along with "get" statements.
So if anyone have any information or ideas please share.
For an example, im trying to convert this to vb.net but im kinda struggling.
For Example, i don't know what the new get and put statements are in vb.net.
VB.NET Syntax (Toggle Plain Text)
Dim aS As String Dim aF As String Open App.Path & "\s.exe" For Binary #1 aS = Space(LOF(1)) Get #1, , aS Close #1
And in my view of conversion is
VB.NET Syntax (Toggle Plain Text)
Dim aS As String Dim aF As String FileOpen(1, "\s.exe", OpenMode.Binary, OpenAccess.ReadWrite) aS = Space(LOF(1)) FileGet(1, aS) FileClose(1)
NOTE: THen of course i forgot to add the put statements so the bytes and data would be able to be written into the file. I forgot to add it, and too lazy to add it -.-'. So if anyone knows how i can use the "put" statements in vb.net along with "get" statements.
So if anyone have any information or ideas please share.
Last edited by Ixeman; Sep 13th, 2008 at 2:53 am.
vb.net Syntax (Toggle Plain Text)
Dim swFile As System.IO.StreamWriter swFile = System.IO.File.CreateText("c:\myfile.txt") swFile.Write("MyText") swFile.Close() Dim srFile As System.IO.StreamReader Dim sTextRead As String srFile = System.IO.File.OpenText("c:\myfile.txt") sTextRead = srFile.Read() Debug.Print(sTextRead) srFile.Close()
This is not exactly what you want, but it will give you an idea.
ps: if someone see's that there is better code or my code is not correct or lack please point to it because I am still learning

hth
Samir Ibrahim
![]() |
Similar Threads
- Reading Binary Files in VB (Visual Basic 4 / 5 / 6)
- reading ints from a binary file (C)
- Help reading/writing to text files... (C++)
- Reading or writing a double into a bin file (C++)
- Saving to a file from an array in C ? (C)
- Need help with Binary files and data types in VB6 (Visual Basic 4 / 5 / 6)
- Read content of *.dat (Java)
- binary file manipulations (C)
Other Threads in the VB.NET Forum
- Previous Thread: Playing wav file
- Next Thread: Closest match
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2008 access arithmetic array assignment basic binary bing box button buttons c# center code combobox component connectionstring convert cpu data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net editvb.net excel file-dialog firewall folder google hardcopy image images isnumericfuntioncall listview login math memory mobile ms mssqlbackend mysql navigate net networking opacity output pan peertopeervideostreaming picturebox picturebox1 plugin port print printing printpreview problemwithinstallation project record reports" save savedialog serial server sorting sql storedprocedure string structures studio temp text textbox timer toolbox updown upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet view visual visualbasic visualbasic.net visualstudio web wpf





