This should hopefully be a quick question. i have an openDialog box in my project, which works when opening a file - however, when no file is selected and the user clicks cancel on the dialog box, the program crashes, because it obviously cannot load a file into memory
The code is as follows
Expand|Select|Wrap|Line Numbers
- Dim strm As System.IO.Stream
- Dim name As System.IO.Stream
- strm = dialogFile.OpenFile()
- txtFileName.Text = dialogFile.FileName.ToString()
- lblSize.Text = FileLen(dialogFile.FileName.ToString())
- If Not (strm Is Nothing) Then
- End If
Thanks
Sam