-
const lie=3 'แก้ไขจำนวนคอลัมน์
const tablewidth="33%" 'กำหนดความกว้างของตาราง
const tableheight="18%" 'กำหนดความสูงของตาราง
const imgwidth="15%" 'กำหนดความกว้างของตาราง
const imgheight="27.5%" 'กำหนดความสูงของตาราง
const fontsize="12px;" 'กำหนดขนาดของข้อความ
const txtwidth="120" 'ความกว้างของตารางข้อความทางด้านขวาของรูปภาพ
const txtheight="18%" 'ความสูงของตารางข้อความทางด้านขวาของรูปภาพ
const txtalign="left" 'การจัดตำแหน่งข้อความทางด้านขวาของรูปภาพ: ซ้าย, กลาง, ขวา'TOP
เน้นว่าไฟล์นั้นเป็นไฟล์ Word
ฟังก์ชั่นdoctop()
doctop="<html xmlns:v=""urn:schemas-microsoft-com:vml"" xmlns:o=""urn:schemas-microsoft-com:office:office"" xmlns:w=""โกศ:schemas -microsoft-com:office:word"" xmlns="" http://www.w3.org/TR/REC-html40""><head><title >สร้างผลลัพธ์</title><meta http-equiv= ประเภทเนื้อหา content=""text/html; charset=gb2312""></meta><meta name=ProgId content=Word.Document></meta><meta name=Generator 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{ หน้า:Section1;}ตาราง{font-size:"&fontsize&"}</style></meta></head>"+chr(13)+chr(10)
ฟังก์ชันสิ้นสุด
ฟังก์ชัน 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="" "&imgความสูง&"""/></td>"
imgtotable=imgtotable+"<td colspan=""2"" align=""center"">"
imgtotable=imgtotable+"<table width="&txtwidth&" height="&txtheight&"><tr><td align="""&txtalign&""">"&replace(lcase(fto.name),"."&dext,"") &"</td></tr><tr><td align="""&txtalign&""">นักแสดง</td></tr><tr><td align="""&txtalign&""">ภาษา </td></tr><tr><td align="""&txtalign&""">ความจุ</td></tr><tr><td align="""&txtalign&""">ประเภท</ td></tr><tr><td td></tr></table>"
imgtotable=imgtotable+"</td></tr></table>"+chr(13)+chr(10)
ฟังก์ชั่นสิ้นสุด
ฟังก์ชั่น imagetodoc (fpath, fpar)
ตั้งค่า fto=fso.createtextfile(fpath&"/Run result.doc",True)
fto.writelinedoctop()
fto.writeline "<body topmargin=0 leftmargin=0><table width=""64"" height=""100%"" border=1><div class=Section1>"
สำหรับการสาธิตแต่ละรายการใน fpath.files
dext=Lcase(fso.getExtensionName(สาธิต))
ถ้า dext="jpg" หรือ dext="gif" หรือ dext="png" แล้ว
ถ้า (ฉันโกหก)=0 ดังนั้น fto.writeline " <tr>"+chr(13)+chr(10)
ฉัน=ฉัน+1
fto.writeline "<td>"
'สำหรับการแก้ไขปัญหา
'fto.writeline "123"
fto.writeline imgtotable (สาธิต fpar dext)
fto.writeline "</td>"+chr(13)+chr(10)
ถ้า (ฉันโกหก)=0 แล้ว i=0:fto.writeline " </tr>"+chr(13)+chr(10)
สิ้นสุดถ้า
ต่อไป
fto.ปิด
response.write "</div></table></body>"
response.write ""&fpo&fpath&"Run result.doc"" การสร้างเสร็จสมบูรณ์<br />"
ตั้งค่า fto=nothing
สิ้นสุด
ชุดฟังก์ชัน fso=server.createobject("scripting.filesystemobject")
ตั้งค่า fpo=fso.getfolder(server.mappath("./"))
สำหรับการสาธิตแต่ละรายการใน fpo.subfolders
โทร imagetodoc(สาธิต,"")
ต่อไป
ตั้งค่า fpo=nothing
ตั้งค่า fso=nothing
-