Okay so I am very new to visual basic I am currently using VB 2010 I know that this is not the correct forum but I figured it was the closest to it since there is no VB 2010.
Anyways I am making a program for my Dad's company that can keep track of inventory so I need to store the info in a .txt and load it up etc. I currently am using a stream writer to write to the text and I got that down pat I am just having troubles loading it back up and putting the info in specific text boxes aka sorting or parsing? the information. I have looked at several tutorials and the problem is that I just simply don't know what I am looking at I've been tinkering with it for a couple hours now with no luck so I hope you guys could help me out.
Here is my current code. It is kind of useless because I have tried so many methods I thought maybe I could use a ReadAll function have it go to a string and parse from there hoping it would have been easier but it has not worked out for me so far.
This was just for testing purposes to see if I could get the reading to go the current code does read the text file and TextBox1.text displays all of the information in the text file (test.txt)Code:Imports System.IO Public Class FormPartList Dim fileReader As System.IO.StreamReader Dim Path As String = "c:\testfolder1\test.txt" Dim StrStorage As String Dim StrTest As String Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If File.Exists(Path) Then Using tr As TextReader = New StreamReader(Path) StrStorage = tr.ReadToEnd() End Using End If TextBox1.Text = StrStorage End Sub End Class
^This above is just the output in test.txt and what will eventually need to get sorted into respective text/list boxesCode:***NEW ITEM**1 254-2 Drawing Number: 254-2 Part Name: Mikes Part Material: Aluminum Finish: Brushed Price: 50.00 Invoice: 323 Shipping: 654-256 Quantity: 80 Purchase Order: 956
Thank you in advance I'm hoping someone could help me out here![]()




.
Reply With Quote