OK Stimbo, i'm ready for you to beat me up again.
This is what I have, during debugging it works just fine. But when I publish it and install it from CD-Rom i keep getting:
Unhandled exception, cannot find file c:\users\name\docs\openfiledialg.
Code:Dim strList As String Dim mystreamreader As New StreamReader(OpenFileDialog1.FileName, True) OpenFileDialog1.InitialDirectory = "c:\temp\" OpenFileDialog1.Title = "Select a File" OpenFileDialog1.FileName = "" OpenFileDialog1.Filter = "Text Files (*.txt)|*.txt" OpenFileDialog1.FilterIndex = 1 OpenFileDialog1.FileName = "myfile" If OpenFileDialog1.ShowDialog() <> Windows.Forms.DialogResult.Cancel Then lbxInput.Items.Clear() strList = mystreamreader.ReadLine() Do Until strList Is Nothing lbxInput.Items.Add(strList) strList = mystreamreader.ReadLine() Loop mystreamreader.Close() mystreamreader.Dispose() gbxRandom.Enabled = True gbxResults.Enabled = True End If




Reply With Quote