I need to read a text file, find a line that contains "ComputerName=" then write this line to a string variable I can set to a label on my form. Does anyone have code for this?? Closest thing I have (which doesnt work) is coded: 
	
	
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
	
		
			
		
		
	
				
			
			
				VB.NET:
			
		
		
		' Open file.txt with the Using statement.
        Using r As System.IO.StreamReader = New System.IO.StreamReader("file.ini")
            ' Store contents in this String.
            Dim line As String
            ' Read first line.
            line = r.ReadLine
            ' Loop over each line in file, While list is Not Nothing.
            Do While (line.Contains("ComputerName="))
                ' Add this line to list.
                line.ToString(ComputerName)
                ' Read in the next line.
                line = r.ReadLine
            Loop
        End Using
        lblComputerName.Text = ComputerName 
	 
 
		 I use Hungarian too sometimes, for forms with lots of controls where I need to access particular controls by code I find it easier to remember thus faster to type finding for example buttons by typing Me.btn... and textboxes with Me.txt... etc (or sometimes with other category/functionality prefix). Because the fields holding these controls is not declared anywhere accessible to read (buried in Designer generated code), one can otherwise not find these names easily.
 I use Hungarian too sometimes, for forms with lots of controls where I need to access particular controls by code I find it easier to remember thus faster to type finding for example buttons by typing Me.btn... and textboxes with Me.txt... etc (or sometimes with other category/functionality prefix). Because the fields holding these controls is not declared anywhere accessible to read (buried in Designer generated code), one can otherwise not find these names easily. 
 
 
		 
 
		