مثال يوضح هل يمكن اخراج ملفات بالفيجوال بيسك
الكود:
الكود:
The System.IO.File.Exists method returns True if a file exists. | |||||
Private Sub Form1_Load(ByVal sender As System.Object, ByVal _
e As System.EventArgs) Handles MyBase.Load
Dim file_path As String = Application.StartupPath
file_path = file_path.Substring(0, _
file_path.LastIndexOf("\"))
If System.IO.File.Exists(file_path & "\Form1.vb") Then
lblFile1.Text = "Form1.vb exists"
Else
lblFile1.Text = "Form1.vb does not exist"
End If
If System.IO.File.Exists(file_path & "\Missing.vb") Then
lblFile2.Text = "Missing.vb exists"
Else
lblFile2.Text = "Missing.vb does not exist"
End If
End Sub
| |||||
للتحميل: إضغط هنا |