Reading value from a file

  • Thread starter Thread starter Nwulf
  • Start date Start date
N

Nwulf

Guest
Do I need to use Serialization/deserialization or what ever to read one line from a file?

I need to read a value from a scale which is connected to my computer via the comm port (rs232). I cant get vb.net to communicate with the scale, so I am going to write a small program using BASIC to write the scale reading to a file called weight.txt. There will always be one line of data in that file (example 45000).

I would like to open the weight.txt file and read the value and disply it on a form. Is there an easy way to do this? Using just plain VB to do this is sooooooo simple, but using VB.net is a challenge.

Thanks.

Nick
 
It is extremely easy to read text from a file in c# and vb.net just use.

this is C# but vb.net is almost exactly the same:

StreamReader S = new StreamReader(path);
S.ReadToEnd();
 
Back
Top