Hi nauna,
Use Directory class GetFiles method.
Please refer below code.
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
string[] files = System.IO.Directory.GetFiles(Server.MapPath("~/"), "*.aspx",
System.IO.SearchOption.AllDirectories);
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim files As String() = System.IO.Directory.GetFiles(Server.MapPath("~/"), "*.aspx",
System.IO.SearchOption.AllDirectories)
End Sub