Reputation: 163
i want to create a list of all aspx pages contained in my website.
but i am getting only 40 pages. but there are more than 2000 pages.
Kindly tell me how can i get all the aspx page list. I am using the following code to get url pages list.
private string[] GetAllUrls(string str)
{
string pattern = @"<a.*?href=[""'](?<url>.*?)[""'].*?>(?<name>.*?)</a>";
System.Text.RegularExpressions.MatchCollection matches = System.Text.RegularExpressions.Regex.Matches(str, pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase);
string[] matchList = new string[matches.Count];
int c = 0;
foreach (System.Text.RegularExpressions.Match match in matches)
matchList[c++] = match.Groups["url"].Value; return matchList;
}
Upvotes: 1
Views: 3775
Reputation: 410
I don't know how you are getting these 40 files, but you can do this:
String[] Files = Directory.GetFiles("C:\\YourSorceCodeDirectory", "*.aspx", SearchOption.AllDirectories);
Upvotes: 3