Binary Reader help needed for Beginner!

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2008
Posts: 5
Reputation: ferrier18 is an unknown quantity at this point 
Solved Threads: 0
ferrier18 ferrier18 is offline Offline
Newbie Poster

Binary Reader help needed for Beginner!

 
0
  #1
Nov 6th, 2008
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.

  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()
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC