Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • 8 months later...
Posted

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();

C#

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...