I have a folder path which i chose at runtime. Now i want to check if the Folder contains files with extension .txt. How to do this.

Try this:

Imports System
Imports System.IO

Public Class Form1
    Dim fi As FileInfo()
    Dim di As DirectoryInfo

    Private Sub GetFiles(ByVal Path As String, ByVal Filter As String)
        di = New DirectoryInfo(Path)
        fi = di.GetFiles(Filter)
        For Each File As FileInfo In fi
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        GetFiles("d:\banner\", "*.txt")
    End Sub
End Class