Submission of tree structures in asp Programming

Source: Internet
Author: User

Demo: 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> Web bookmarks </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.exe cute ("insert into menu (id1, menuname, URL) values (" & A (S (0)-1) & ", '" & S (1) & "','" & S (2 )&"')")
If S (2) = "" then
Set rs1_conn.exe cute ("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
%>
First, adjust the internet security area to the bottom. <Br>
First, press the "LOAD" button and you may be prompted: "The Interaction Between ActiveX controls on this page and other parts of this page may be insecure. Do you want to allow this interaction? "
Select Yes to load the favorites content. Click the submit button to save the favorites folder.
<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 ++ "/t" + F. Name + "/T/N ";
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 );
File = FSO. GetFile (FC. Item ());
TS = file. openastextstream (1, 0 );
STR = ts. Readline ();
While (Str. indexof ("url =") <0 &&! TS. atendofstream)
{
STR = ts. Readline ();
}
TS. Close ();
S + = I + "/t" + filename + "/t" + Str. substr (Str. indexof ("url =") + 4) + "/N ";
}
}
Fc = new enumerator (F. subfolders );
For (;! FC. atend (); FC. movenext ())
{
Showfolderfilelist (I, FC. Item ());
}
Return (s );
}
Function EXE ()
{
Document. form1.tt. value = showfolderfilelist (1, document. form1.t. value)
}
</SCRIPT>
<Form name = "form1" method = "Post" Action = "favorite. asp? Action = save ">
<Input name = "T" type = "text" id = "T" value = "C: // Documents and Settings // administrator // favorites" size = "70">
<Textarea name = "TT" Cols = "120" rows = "30" Wrap = "virtual"> </textarea>
<Br>
<Input type = "button" name = "Submit" value = "LOAD" onclick = "EXE ();">
<Input type = "Submit" name = "Submit" value = "Submit">
</Form>
<%
End if
%>
</Body>
</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.