C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » ASP.NET GridView »

Creating sitemap of a website


Posted Date: 16 Sep 2009    Resource Type: Code Snippets    Category: ASP.NET GridView
Author: joseph sajMember Level: Gold    
Rating: 1 out of 5Points: 3



SiteMap


This sample shows how to Create sitemap of a website


<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.IO" %>
<script runat="server">
Sub Page_Load(Source as Object, E as EventArgs)

getDir(Server.MapPath("."))
end sub

Sub getDir(strDir)

Dim subdirectoryEntries As String() = Directory.GetDirectories(strDir)

If Directory.Exists(strDir) Then
Try

Dim subdirectory As String
For Each subdirectory In subdirectoryEntries
rstText.Text += subdirectory & "<br>"
listFiles(subdirectory)
getDir(subdirectory)
Next subdirectory
Catch ex As Exception
strMsg.Text = "Error : " & ex.toString()
End Try
end if
end sub
Sub listFiles(strDir)
try

Dim fileEntries As String() = Directory.GetFiles(strDir)

Dim fileName As String
For Each fileName In fileEntries
rstFiles.text += fileName & "<br>"

Next fileName
Catch ex As Exception
strMsg.Text = "Error : " & ex.toString()
End Try

end sub
</script>
<html><head><title>Site Map</title></head><body>

<asp:label id="rstText" runat="server" Font-Names="Verdana" Font-Size="12px"/>
<p>
<asp:label id="rstFiles" runat="server" Font-Names="Verdana" Font-Size="12px"/>
<p>
<asp:label id="strMsg" runat="server" Font-Names="Verdana" Font-Size="12px"/>

</body></html>




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Sitemap  .  Asp.net  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Checks for a Web Crawler
Previous Resource: A database example
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET GridView


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use