OpenFileDialog.CheckFileExists : OpenFileDialog « System.Windows.Forms « VB.Net by API






OpenFileDialog.CheckFileExists

  

Imports System
Imports System.Drawing
Imports System.Data
Imports System.IO
Imports System.Collections
Imports System.Windows.Forms
Imports System.Drawing.Printing

Public Class MainClass
    Shared Sub Main()
        Dim myFileDialog As OpenFileDialog = New OpenFileDialog()

        With myFileDialog
            .Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*"
            .FilterIndex = 1
            .InitialDirectory = "C:\"
            .Title = "Open File"
            .CheckFileExists = False
        End With

        If myFileDialog.ShowDialog() = DialogResult.OK Then
            Console.WriteLine(myFileDialog.FileName)
        End If
        myFileDialog = Nothing
    End Sub
End Class

   
    
  








Related examples in the same category

1.OpenFileDialog.AddExtension
2.OpenFileDialog.CheckPathExists
3.OpenFileDialog.Filter
4.OpenFileDialog.FilterIndex
5.OpenFileDialog.InitialDirectory
6.OpenFileDialog.ShowDialog()
7.OpenFileDialog.Title