Three functions-array assignment-drop down list output-fetch drive

Source: Internet
Author: User
Functions | drives | arrays | dropdown | dropdown | function | drive | array | dropdown | dropdown list <TITLE> New Document </TITLE>
<meta name= "generator" content= "EditPlus" >
<meta name= "Author" content= "" >
<meta name= "Keywords" content= "" >
<meta name= "Description" content= "" >
<style>
BODY{TEXT-ALIGN:LEFT;FONT:12PX #000080;}
#main {float:left;width:680px;border: #0000ff 1px solid;margin:5px 20px;padding:10px 100px;}
#main p{}
</style>

</HEAD>

<BODY>
<div id= "Main" >
<%
' Option Explicit
Select Case Request ("ActionName")
Case "Find"
Call Find (Request ("DirName"))
Case "Entry"
Call Enterdir (Request ("DirName")
Case otherwise
Call Showmain ()
End Select

Actionarray=storearrayvalue ("Find, search, go, enter", ",")
Drvname=split (Showdrivelist, ",")
Response.Write "<form name=drv action=find.asp>"
Response.Write Writeselect (Actionarray,actionname)
Response.Write Writeselect (Drvname,dirname)
Response.Write "<input type=submit name=action value= start ></form>"

' This function is used to assign a value to an array, arrayvalue the string value to be assigned, splitmethod the basis for splitting this string

Function Storearrayvalue (Arrayvalue,splitmethod)
Storearrayvalue=split (Arrayvalue,splitmethod)
End Function

' This function returns the Drop-down list string, arrayname as the passed-in array name, sltname the name of the Drop-down list

Function Writeselect (Arrayname,sltname)
Dim slt,i
slt= "<select name=" & Sltname & ">"
For i=0 to UBound (arrayname)
Slt=slt & "<option value=" & Arrayname (i) & ">" & Arrayname (i) & "</option>"
Next
Slt=slt & "</select>"
Writeselect=slt
End Function

' This function returns all drives

Function showdrivelist
Dim FSO, D, dc,i,s
Set fso = CreateObject ("Scripting.FileSystemObject")
Set DC = fso. Drives
I=0
For each D in DC
s=s&d.driveletter& ","
I=i+1
Next
S=mid (S,1,len (s)-1)
Showdrivelist=s
End Function

' This process outputs the capacity status of the selected drive.
Showdriveinfo ("E:\")
Sub Showdriveinfo (Drvpath)
Dim FSO, DRV, s
Set fso = CreateObject ("Scripting.FileSystemObject")
Set DRV = fso. Getdrive (FSO. GetDriveName (Drvpath))
s = "Drive" & UCase (Drvpath) & "-"
s = S & DRV. VolumeName & "<br/>"
s = S & "total spaces:" & FormatNumber (DRV). TotalSize/(1024*1024*1024),-1)
s = S & "GB" & "<br/>"
s = S & "Free Spaces:" & FormatNumber (DRV). FreeSpace/(1024*1024*1024),-1)
s = S & "GB" & "<br/>"
Response.Write S
End Sub

%>
</div>
</body>




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.