Guest Nwulf Posted August 20, 2002 Posted August 20, 2002 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 can't 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 Quote
aewarnick Posted April 27, 2003 Posted April 27, 2003 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(); Quote C#
*Gurus* Derek Stone Posted April 28, 2003 *Gurus* Posted April 28, 2003 Make sure to close the stream afterwards. Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.