%@LANGUAGE=VBScript %>
<%option explicit
On error resume next
Dim fso,spath,sDir,Desc,Title,Speaker,ThisDir,File,arry(100)
Dim sFullName, sLocation_Date, sSource, sNote, sLine, sSummary
Dim objFile, FileSize
Dim Tmp,n,m,p, linenum, st
Const ForWriting = 2
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
'sDir = Request.QueryString("dir))
sDir = "\audio\ThanhTu\GiacNgoVaGiaiThoat"
spath=Server.MapPath("\") & "\" & sDir & "\"
'response.write (spath)
'''''''''''''''''''''''''''''''''''''''''''''
' read description files
'''''''''''''''''''''''''''''''''''''''''''''
Set Desc = fso.OpenTextFile(sPath & "desc.txt",ForReading)
linenum=1
Title = ""
Speaker = ""
sLocation_Date = ""
sSource = ""
sNote = ""
sSummary = ""
st = 0 ' set st to @name
Do While Not Desc.AtEndOfStream
sLine = Trim(Desc.ReadLine)
'
if Mid(sLine,1,1) <> "!" then
if (Instr(sLine,"@name")) > 0 then
st = 1
elseif (Instr(sLine,"@author")) > 0 then
st = 2
elseif (Instr(sLine,"@location")) > 0 then
st = 3
elseif (Instr(sLine,"@note")) > 0 then
st = 4
elseif (Instr(sLine,"@source")) > 0 then
st = 5
elseif (Instr(sLine,"@summary")) > 0 then
st = 6
end if
'
if Mid(sLine,1,1) <> "@" then
Select case st
Case 1
Title = Title & sLine
Case 2
Speaker = Speaker & sLine
Case 3
sLocation_Date = sLocation_Date & sLine
Case 4
sNote = sNote & sLine
Case 5
sSource = sSource & sLine
Case 6
sSummary = sSummary & sLine
end select
end if
end if 'not a comment line
Loop
Desc.Close
'Response.write("Speaker=" & Speaker & "
")
'Response.write("Title=" & Title & "
")
'Response.write("Location=" & sLocation_Date & "
")
'Response.write("Note=" & sNote & "
")
'Response.write("Source=" & sSource & "
")
'''''''''''''''''''''''''''''''''''''''''''''
' end read description files
'''''''''''''''''''''''''''''''''''''''''''''
%>
<%=Title%>
TRACK |
DUNG LƯỢNG |
NGHE PHÁP |
<%
Set ThisDir = fso.GetFolder(spath)
n=1
For each objFile in ThisDir.Files
Tmp=ucase(right(objFile.name,4))
If Tmp=".MP3" Then
%>
Track 01 |
<%=FormatNumber(objFile.Size/(1024*1024),2)%> MB |
"><<>> |
<%end if%>
<%Next%>
|