943,691 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 1183
  • VB.NET RSS
Nov 6th, 2008
0

Binary Reader help needed for Beginner!

Expand Post »
Hey Guys,
I'm trying to read a Binary file located at C:\Temp\SAMPLE.DAT
values in the file have been stored in format: int32,int32, Double.
1 33 172.50
2 55 40
3 77 5000
1 99 20
4 200 0

I'm trying to read the file and display the results in a richtextbox in this format:
1, 33, 172.50
2, 55, 40
3, 77, 5000
1, 99, 20

Here's the code that i have. I'm stuck and can't think of what else to do, any help would be much appreciated! Thank you very much.

VB.NET Syntax (Toggle Plain Text)
  1. Dim vMessage As String
  2. Dim objBinRdr As New BinaryReader(New FileStream("C:\temp\sample.dat", FileMode.Open, FileAccess.Read))
  3. Dim rvValues As String
  4. Dim vDelimiters() As Char = {",", "/", ";", ":"}
  5.  
  6. Do While objBinRdr.PeekChar <> -1
  7. rvValues = objBinRdr.ReadInt32.ToString(vDelimiters)
  8. vMessage = objBinRdr.ReadInt32()
  9. RichTextBox1.AppendText(vMessage)
  10.  
  11. Loop
  12. objBinRdr.Close()
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ferrier18 is offline Offline
5 posts
since Mar 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Creating or opening existing tables
Next Thread in VB.NET Forum Timeline: Installation vb.net application





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC