How to check if file exists in VB.NET

1 Answer

0 votes
Imports System
Imports System.IO

Public Class Program
	Public Shared Sub Main()
        Dim FileName = "C:\Project\file.bin"

        If File.Exists(FileName) Then
            Console.WriteLine("File Exists")
        Else
            Console.WriteLine("File Not Exists")
        End If
    End Sub
End Class






' run:
'
' File Not Exists
'

 



answered May 2, 2022 by avibootz
...