< %
const lie = 3 'modify the number of columns
const tableWidth = 33% 'Define the width of the form
Const tableheight = 18% 'Define the height of the table
Const Imgwidth = 15% 'Define the width of the table
const Imgheight = 27.5% 'Define the height of the table
const fontsize = 12px; 'Define the size of the text
const txtwidth = 120 'picture right text table width
const txtheight = 18% 'picture right text table high
const txtalign = left 'picture right text alignment method: left, in center, right right
'TOP emphasizes that the file is a word file
Function doctop ()
Doctop = <html xmlns: v = Urn: Schemas-Microsoft-COM: VML XMLNS: O = Urn: Schemas-Microsoft-COM: Office: W = Urn: Schmas- Microsoft-COM: Office: Word XMLNS = HTTP : //www.w3.org/tr/rec- HTML40> <head> <Title> Generate results </title> <meta http-equiv = content-type content = text/html; charset = gb2312> </meta> </meta> </meta> </meta> </meta> <meta name = Progid Content = Word.document> </Meta> <meta name = GENATOR Content = Microsoft Word 10> </Meta> <meta name = ORIGINATOR Content = Microsoft Word 10> <STYLE TYPE = Text/CSS>@ Page section1 {margin: 30pt 8.5pt 5.65pt 12pt;} div.section1 {page: section1;} table {font-size: & fontsize &} </Meta> </head>+chr ( 13)+CHR ( 10)
end function
Function Imgtotable (FTO, FPAR, DEXT)
Imgtotable = <Table Width = & Tablewidth & Height = & TableHeight & Border = 0>
Imgtotable = Imgtotable+<TR VALIGN = TOP> <TD> <IMG SRC = & Replace (DEMO, FPAR,) & Width = & Imgwidth & Height = & Imageighryigh &/> </td>
Imgtotable = Imgtotable+<td Colspan = 2 Align = Center>
Imgtotable = Imgtotable+<Table Width = & TXTWIDTHT & Height = & TXTHEIGHT &> <TD Align = & TXTALIGN &> & Replace (FTO.NAME),. & DEXT,) & </TD> </TR> <TR> <TD Align = & txtalign &> Actor </td> </tr> <lign = & txtalign &> Language </td> </tr> <td align = & txtalign &> capacity </td> </tr> <ter> <TD Align = & TXTALIGN &> Type </td> </tr> </table>
imgtotable = Imgtotable+</td> </tr> </table>+chr (13)+chr (10)
end function
Function ImageTodoc (FPATH, FPAR)
set fto = fso.createtextFile (FPATH &/Run results.doc, true)
fto.writeline doctop ()
fto.Writeline <body topmargin = 0 leftmargin = 0> <table width = 64 height = 100% border = 1> <div class = section1>
For Each Demo in FPATH.FILES
dext = lcase (FSO.GetextensionName (demo))
if dext = jpg or deb = gif or dext = png then
if (i mod lie) = 0 then fto.writeline <tr>+chr (13)+chr (10)
I = i+1
fto.Writeline <TD>
'Used for errors
'fto.writeline 123
FTO.Writeline Imgtotable (Demo, FPAR, DEXT)
fto.Writeline </td>+chr (13)+chr (10)
if (i mod lie) = 0 then I = 0: fto.writeline </tr>+chr (13)+chr (10)
end if
next
fto.close
response.write </div> </table> </body>
Response.write & fao & fpath &/Run results. DOC is generated. <br />
set fto = nothing
end function
set fso = server.createObject (scripting.filesystemObject)
set fo = fso.getfolder (server.mappath (./))
For Each Demo in FPO.Subfolders
call imagetodoc (demo,)
next
set fo = nothing
set fSO = Nothing
%>