|
-
Dec 10th, 2000, 08:54 PM
#3
a listbox? not at all. I'm doing this:
<%@ Language="VBScript" %>
<html>
<head>
<%
'Define the File System Object and set variables
Dim FSO, Folder, FolderContents, FileItem
Set FSO = CreateObject("Scripting.FileSystemObject") 'Create FSO
Set Folder = FSO.GetFolder("C:\muzik\hip-hop - rap") 'Declare folder to have contents displayed
Set FolderContents = Folder.Files
%>
<title><%= Response.Write(Folder.Name) %></title>
<style type="text/css">
body, table {color:#000000; font-family:Verdana; font-size:11px}
</style>
</head>
<body>
<form action="Confirm.asp" method="post">
<table border="0" cellpadding="4" cellspacing="0">
<tr><td bgcolor="darkgray" align=left>
</td><td bgcolor="darkgray" align=left>
<font size="2"><b>File</b></font>
</td><td bgcolor="darkgray" align=left>
<font size="2"><b>Size (mb)</b></font>
</td></tr>
<%
'Display each file's name and size with a checkbox
Response.Write("<font size=5>Contents of: " & Folder & "<p>")
Dim FileSize
For Each FileItem In FolderContents
FileSize = Round(FileItem.Size / 1000000, 1) 'Converts file size into MB, rounds to tenth place
Response.Write("<tr><td bgcolor=lightgrey align=left>")
Response.Write("<input type='checkbox'>")
Response.Write("</td><td bgcolor=lightgrey align=left>")
Response.Write(FileItem.Name) 'Displays file name
Response.Write("</td><td bgcolor=lightgrey align=right>")
Response.Write(FileSize) 'Displays file size in MB
Response.Write("</td></tr>")
Next
%>
</td></tr>
<tr><td colspan=3>
<input type="submit" value="Delete">
</td></tr>
</table>
</form>
</body>
</html>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|