|
-
May 22nd, 2002, 11:51 AM
#1
error handling in vb.net
I am trying to capture errors specific to the floppy drive. I want to capture the error number for floppy not in drive, disk write protected and file not found, any help appreciated Thanks
-
May 22nd, 2002, 01:40 PM
#2
Here is how to check if floppy is in
Imports System.IO
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
#End Region
Dim Retries As Short = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
PictureBox1.Image = System.Drawing.Bitmap.FromFile("a:\fileopen.bmp")
Catch
Retries += 1
If Retries <= 2 Then
MsgBox("Please insert the disk in drive A!")
Else
MsgBox("File Load feature disabled")
Button1.Enabled = False
End If
End Try
End Sub
End Class
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|