- Home
·
- Active Server Pages
·
- Good Example for read all File Names from any directory and linking it on one page Using Content Li
Good Example for read all File Names from any directory and linking it on one page Using Content Li
Good Example for read all File Names from any directory and linking it on one page Using Content Linking Component
Rate Good Example for read all File Names from any directory and linking it on one page Using Content Li
(2(2 Vote))
<%dim MyFso, MyDir, MyFile, LinkObj, Count
set MyFso = Server.CreateObject("Scripting.FileSystemObject")
set MyDir = MyFso.GetFolder(Server.MapPath("Script/"))
set MyFile = MyFso.CreateTextFile(Server.MapPath("info.txt"),true)
for each FileName in MyDir.Files
MyFile.WriteLine "Script\" & FileName.Name & vbTab & "Size of File=" & FileName.Size
next
MyFile.Close
set LinkObj = Server.CreateObject("MSWC.NextLink")
Count = LinkObj.GetListCount("info.txt")
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<Table border=1>
<%for i = 1 to Count%>
<tr>
<td><a href=<%=LinkObj.GetNthURL("info.txt",i)%>><%=LinkObj.GetNthURL("info.txt",i)%></a></td>
<td><%=LinkObj.GetNthDescription("info.txt",i)%></td>
</tr>
<%next%>
</table>
</BODY>
</HTML>
Good Example for read all File Names from any directory and linking it on one page Using Content Li Comments
No comments yet — be the first to post one!
Post a Comment