Hi,
Can someone throw me a bone, I don't know a fix for this:
Here's me code:
Can someone throw me a bone, I don't know a fix for this:
Code:
Warning 1 Variable 'progName' is used before it has been assigned a value. A null reference exception could result at runtime. H:\X17-59183\PostInstall\PostInstall\SelectPrograms.vb 29 42 PostInstallCode:
Public Class SelectPrograms
Dim Ver As String = " - v1.0.1 Beta 2"
Private Sub SelectPrograms_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Show()
Me.Text = "Post Install By Chris2k" + Ver
Dim iniFile As String = Application.StartupPath + "\Start\InstallCFG.ini"
Dim sR As New IO.StreamReader(iniFile)
Dim line, progName As String
Dim ReadResult() As String
If Not (System.IO.File.Exists(iniFile)) Then
MessageBox.Show("The programs opted for this OS can't be installed as the InstallCFG.ini has not been included...")
End If
line = sR.ReadLine()
Do While Not (line Is Nothing)
ReadResult = line.Split(":") 'Split line at :
If (ReadResult(0).ToLower() = "prog name") Then
progName = TextBox1.Text + ReadResult(1) + Environment.NewLine
End If
line = sR.ReadLine() 'Move on to the next line.
Dim Item As New ListViewItem(progName)
Item.SubItems.Add("progDesc")
Item.SubItems.Add("Size")
ListView1.Items.Add(Item)
Loop
sR.Close()
End Sub
End Class