示範:http://asp2004.net/temp/treemenu/favorite.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>網路書籤</title>
</head>
<body>
<%
action=request.QueryString("action")
if action="save" then
dim a(10)
a(0)=0
tt=request.Form("tt")
t=split(tt,chr(13))
for i=0 to ubound(t)-1
s=split(t(i),chr(9))
conn.execute("insert into menu (id1,menuname,url) values ("&a(s(0)-1)&",'"&s(1)&"','"&s(2)&"')")
if s(2)="" then
set rs=conn.execute("select top 1 id as tp from menu order by id desc")
a(s(0))=rs("tp")
end if
next
response.Redirect("index.asp")
else
%>
先把internet安全區域調至底。<br>
先按“載入”按鈕 ,可能會提示:“在此頁上的ActiveX控制項和本頁上的其他部分互動可能不安全。您想允許這種互動嗎? ”
選擇是,收藏夾內容即可載入。再按提交按鈕即可儲存收藏夾。
<script language="javascript">
var s;
s="";
function ShowFolderFileList(i,folderspec)
{
var fso,f,fc,name;
var url,str,file,filename;
var i;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFolder(folderspec);
s += i++ + "" + f.Name + "";
fc = new Enumerator( f.files );
for (; !fc.atEnd(); fc.moveNext( ) )
{
filename = fso.GetFileName( fc.item( ) );
if (filename.indexOf(".url")>=0)
{
filename = filename.substring( 0 , filename.length-4 );