當前位置:編程學習大全網 - 源碼下載 - 請教壹下treeview的用法

請教壹下treeview的用法

<TABLE>

<%

'日期格式化函數

Function dateform(strdate)

strNowYear = Year(strdate)

strNowMonth = Month(strdate)

strNowDay = day(strdate)

strNowHour = Hour(strdate)

strNowMinute = Minute(strdate)

strNowSecond = Second(strdate)

If strNowMonth<10 Then

strNowMonth="0"&strNowMonth

End If

If strNowDay<10 Then

strNowDay="0"&strNowDay

End If

If strNowHour<10 Then

strNowHour="0"&strNowHour

End If

If strNowMinute<10 Then

strNowMinute="0"&strNowMinute

End If

If strNowSecond<10 Then

strNowSecond="0"&strNowSecond

End If

strNowDate = strNowyear & "-" & strNowmonth & "-" & strNowday &" "&strNowHour & ":" & strNowMinute & ":" & strNowSecond

dateform=strNowDate

End Function

dim objfolder,item,checked,fs,objfd

Set fs = Server.CreateObject("Scripting.FileSystemObject")

dim adminpath

adminpath="e:\我的資料" '改成妳要的目錄

'adminpath=server.mappath("e:\我的資料")

'adminpath=replace(adminpath,"\","/")

'adminpath=right(adminpath,len(adminpath)-instrrev(adminpath,"/"))

response.write adminpath

'response.End

set objfd=fs.getfolder(server.mappath(adminpath))

'-------------------- 顯示目錄 Begin ---------------

For Each item In objfd.subfolders

response.write"<tr>"

response.write"<td>"&item.name&"</a>"

response.write"</td>"

response.write"<td>"&item.datecreated&"</td>"

response.write"<td width=100 align=center>目錄</td>"

'response.write"</tr>"

Next

'-------------------- 顯示目錄 End ---------------

'-------------------- 顯示文件 Begin ---------------

Dim strTmp,arryTmp

For each item in objfd.files

strTmp=strTmp&item.name&"|||"&dateform(item.datecreated)&"@@@"

Next

arryTmp=Split(strTmp,"@@@")

intMaxTmp=UBound(arryTmp)-1

For i=0 To intMaxTmp

arryTmp(i)=Split(arryTmp(i),"|||")

'response.write arryTmp(i)(0)&"<br>"

next

For j=0 To intMaxTmp

For i=0 To intMaxTmp

If i=intMaxTmp Then Exit for

If arryTmp(i)(1)<=arryTmp(i+1)(1) Then

strTmp0=arryTmp(i)(0)

strTmp1=arryTmp(i)(1)

arryTmp(i)(0)=arryTmp(i+1)(0)

arryTmp(i)(1)=arryTmp(i+1)(1)

arryTmp(i+1)(0)=strTmp0

arryTmp(i+1)(1)=strTmp1

End If

Next

Next

For i=0 To intMaxTmp

response.write"<tr>"

response.write"<td width=200>"&" <a href=""webftp.asp?fd="&arryTmp(i)(0)&""">"&arryTmp(i)(0)&"</a>"

response.write"</td>"

response.write"<td width=200>"&arryTmp(i)(1)&"</td>"

response.write"<td width=100 align=center>文件</td>"

'response.write"<td>"&item.datecreated&"</td>"

' response.write"<td class=""c""><input type=""radio"" name=""template"" value="""&item.name&""""&checked&" /></td></tr>"

Next

'-------------------- 顯示文件 End ---------------

set fs=nothing

%>

</TABLE>

自己看著稍稍修改下。。。。

  • 上一篇:求android開機啟動代碼
  • 下一篇:籌碼分布的使用技巧是什麽
  • copyright 2024編程學習大全網