her er noget som jeg bruger og den tager undermapper med
-------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<!-- "This document is made in Stone's WebWriter 2" -->
<TITLE>Domain administration</TITLE>
<META NAME="Generator" CONTENT="Stone''s WebWriter 2">
<% session("AdminAdmin")=true %>
</HEAD>
<FRAMESET FRAMEBORDER="0" FRAMESPACING="0" BORDER="0" ROWS="100%,*" COLS="100%">
<FRAME SRC="admin.asp" NAME="administration" SCROLLING="AUTO">
</FRAMESET>
</HTML>
gemmes som default.asp
--------------------------------------------------
<% Option explicit %>
<% if session("AdminAdmin")<>true then response.redirect "default.asp"%>
<% response.expires = 0 %>
<% response.buffer = true%>
<%
Dim adgId, adgPw, sesPw, Heading, Image
' ***** ADMINISTRATIVE OPLYSNINGER *****
' adgId = loginnavn for gyldig betjening - vises helt
' adgPw = loginkode for gyldig betjening - vises skjult
' sesPw = kode for oprettelse/fjernelse af biblioteker - vises skjult
adgId="test"
adgPw="test"
sesPw="test"
Heading="<FONT SIZE='5'>Velkommen til nytid.dk</FONT>"
Image="<A HREF='../index.htm' TARGET='_top'><IMG SRC='
http://www.nytid.dk/banner/logolin1.gif' BORDER='0' WIDTH='300' HEIGHT='20' ALIGN='BOTTOM' ALT='Til indexsiden på nytid.dk'></A>"
Dim Login, Ident
Login=request.form("adminIdent")
Ident=request.form("adminCode")
if Login=adgId and Ident=adgPw then
session("nytid.admin")=true
end if
if request("logout")="true" then
session("nytid.admin")=false
session.abandon
end if
Dim sessionOk
if session("nytid.admin")=true then
sessionOk=true
else
sessionOk=false
end if
if request("redirOk")<>"" then
response.redirect request("redirOk")
end if
Dim strHomePath, homePath, strFolderPath, folderPath, strApplPath, applPath
homePath = "./../"
applPath = "./"
folderPath = trim(request.form("folder"))
folderPath = Replace (folderPath, "\", "/")
folderPath = Replace (folderPath, "../", "")
folderPath = Replace (folderPath, "./", "")
folderPath = Replace (folderPath, "//", "/")
strHomePath = Server.MapPath(homePath)
strFolderPath = Server.MapPath(homePath&folderPath)
strApplPath = Server.MapPath(applPath)
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<!-- "This document is made in Stone's WebWriter 2" -->
<!-- Minus AutoDato -->
<TITLE>Domain administration</TITLE>
<META NAME="Generator" CONTENT="Stone's WebWriter 3.5">
</HEAD>
<BODY>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD><%=Heading%></TD>
<TD ALIGN="RIGHT"><%=Image%></TD>
</TR>
</TABLE>
<% if sessionOk<>true then %>
<P>
<P>
login = test
Ident = test
<P>
<CENTER>
<TABLE BORDER="0">
<TR><TD>
<FORM NAME="adminForm" ACTION="admin.asp" METHOD="POST">
<TABLE BORDER="0">
<TR>
<TD>Login: </TD>
<TD><INPUT TYPE="TEXT" NAME="adminIdent" SIZE="30"></TD>
</TR>
<TR>
<TD>Ident: </TD>
<TD><INPUT TYPE="PASSWORD" NAME="adminCode" SIZE="30"></TD>
</TR>
<TR>
<TD></TD>
<TD ALIGN="CENTER"><INPUT TYPE="SUBMIT" VALUE="Tryk her!"></TD>
</TR>
</TABLE>
</FORM>
</TD></TR>
</TABLE>
</CENTER>
<P>
<% else %>
<P ALIGN="RIGHT"><A HREF="admin.asp?logout=true">Log ud</A></P>
<P>
<FORM NAME="confirmForm" ACTION="admin.asp" METHOD="POST">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD>Mappe: </TD>
<TD><INPUT TYPE="TEXT" NAME="folder" VALUE="<%=folderPath%>" SIZE="30"></TD>
</TR>
<TR>
<TD></TD>
<TD></TD>
</TR>
<TR>
<TD>Kode: </TD>
<TD><INPUT TYPE="PASSWORD" NAME="adminCode" SIZE="10"></TD>
</TR>
</TABLE>
Opret: <INPUT TYPE="RADIO" NAME="creativity" VALUE="create">
Fjern: <INPUT TYPE="RADIO" NAME="creativity" VALUE="remove">
Liste: <INPUT TYPE="RADIO" NAME="creativity" VALUE="listing" CHECKED>
<P>
<INPUT TYPE="BUTTON" VALUE="Opdater" onClick='nextStep("admin.asp")'>
<P>
<B>Nuværende sti: </B><%=strFolderPath%>
<P>
<%
Dim objFSO, objFile, objHomeFolder, objFolder
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objHomeFolder = objFSO.GetFolder(strHomePath)
Dim folderSize, fileSize
folderSize=0
fileSize=0
Dim folderCount, fileCount, folderMax, fileMax, folderName, fileName
folderCount=0
fileCount=0
folderMax=request("folderCount")
fileMax=request("fileCount")
Dim objFolderContents, objFolderSubFolders, objFolderItem, objFileItem
if strFolderPath=strFolderPath then
select case LCase(Request.Form("creativity"))
case "create"
if objFSO.FolderExists(strFolderPath) then
response.write "<P>Stien eksisterer allerede!"
else
if sesPw=Ident then
Dim strObj, strObjFirst, strObjLast, slash, slashLast
strObj = folderPath
strFolderPath = Server.MapPath(homePath&strObj)
slashLast = InStr(strObj, "/")
while slashLast>0
strObjFirst = Mid(strObj, 1, slash)
strObjLast = Mid(strObj, slash+1, Len(strObj)-slash+1)
strFolderPath = Server.MapPath(homePath&strObjFirst)
if NOT objFSO.FolderExists(strFolderPath) and InStr(strFolderPath, strApplPath)<>1 then
objFSO.CreateFolder(strFolderPath)
end if
slashLast = InStr(strObjLast, "/")
slash = Len(strObjFirst) + slashLast
wend
strFolderPath = Server.MapPath(homePath&folderPath)
if NOT objFSO.FolderExists(strFolderPath) and InStr(strFolderPath, strApplPath)<>1 then
objFSO.CreateFolder(strFolderPath)
end if
else
response.write "<P><B>HUSK: </B>"&chr(34)&"Kode"&chr(34)
end if
end if
case "remove"
if sesPw<>Ident then
response.write "<P><B>HUSK: </B>"&chr(34)&"Kode"&chr(34)
else
Set objFolder = objFSO.GetFolder(strFolderPath)
Set objFolderContents = objFolder.Files
Set objFolderSubFolders = objFolder.SubFolders
For folderCount=1 to folderMax
folderName=request("folder"&folderCount)
if folderName<>"" and objFSO.FolderExists(strFolderPath &"\" &folderName) and InStr(strFolderPath &"\" &folderName, strApplPath)=0 then
objFSO.DeleteFolder(strFolderPath &"\" &folderName)
end if
Next
For fileCount=1 to fileMax
fileName=request("file"&fileCount)
if fileName<>"" and objFSO.FileExists(strFolderPath &"\" &fileName) and InStr(strFolderPath, strApplPath)=0 then
objFSO.DeleteFile(strFolderPath &"\" &fileName)
end if
Next
end if
case else
' response.write "Else"
end select
end if
if NOT objFSO.FolderExists(strFolderPath) then
response.write "<P>Stien eksisterer ikke!"
else
Set objFolder = objFSO.GetFolder(strFolderPath)
Set objFolderContents = objFolder.Files
Set objFolderSubFolders = objFolder.SubFolders %>
<TABLE WIDTH="50%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<tr>
<TD WIDTH="10%"><B>Slet</B></td>
<TD WIDTH="20%"><B>Objekt</B></td>
<TD WIDTH="20%"><B>Størrelse</B></td>
<TD WIDTH="50%"><B>Ændret</B></td>
</tr>
<tr>
<TD COLSPAN="4"><HR></td>
</tr>
<%
response.write "<p>"
For Each objFolderItem in objFolderSubFolders
folderCount=folderCount+1
response.write "<tr><td align='center'><INPUT TYPE='checkbox' " &"NAME='folder"&folderCount &"' VALUE='" &objFolderItem.Name &"'></td>"
response.write "<td><b>" &objFolderItem.Name &" </b></td>"
response.write "<td>" &objFolderItem.Size &" </td>"
response.write "<td>" &objFolderItem.DateLastModified &"</td>"
folderSize = folderSize + objFolderItem.Size
Next
' response.write "<p>"
For Each objFileItem in objFolderContents
fileCount=fileCount+1
response.write "<tr><td align='center'><INPUT TYPE='checkbox' " &"NAME='file"&fileCount &"' VALUE='" &objFileItem.Name &"'></td>"
response.write "<td>" &objFileItem.Name &" </td>"
response.write "<td>" &objFileItem.Size &" </td>"
response.write "<td>" &objFileItem.DateLastModified &"</td>"
fileSize = fileSize + objFileItem.Size
Next
%>
<INPUT TYPE="hidden" VALUE="<%=folderCount%>" NAME="folderCount">
<INPUT TYPE="hidden" VALUE="<%=fileCount%>" NAME="fileCount">
</table>
<P>
<B>Forbrugt plads: </B> <%=folderSize+fileSize &" byte"%>
<%
end if
%>
<SCRIPT LANGUAGE="JavaScript"><!--
function nextStep(jobType) {
document.confirmForm.action=jobType;
document.confirmForm.submit();
}
// -->
</SCRIPT>
<% end if %>
</FORM>
<P>
<HR>
<CENTER><FONT SIZE="2">© Copyright 2000, <A HREF="admin.asp?logout=true&redirOk=http://surf.to/steen_a/" TARGET="_top">Steen Andersen</A><BR>
All Rights Reserved</FONT></CENTER>
</BODY>
</HTML>
gemmes som admin.asp
--------------------------------------------------