asp fso 生成html,ASP实现生成网页输出Word文件

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"'图片右侧文字对齐方式:left左、center中、right右

'TOP强调该文件为Word文件

function doctop()

doctop="

生成结果"+chr(13)+chr(10)

end function

function imgtotable(fto,fpar,dext)

imgtotable="

    imgtotable=imgtotable+"

"

imgtotable=imgtotable+"

"

imgtotable=imgtotable+"

"&replace(lcase(fto.name),"."&dext,"")&"
演员
语言
容量
类型
"

imgtotable=imgtotable+"

"+chr(13)+chr(10)

end function

function imagetodoc(fpath,fpar)

set fto=fso.createtextfile(fpath&"/运行结果.doc",True)

fto.writeline doctop()

fto.writeline "

"

for each demo in fpath.files

dext=Lcase(fso.getExtensionName(demo))

if dext="jpg" or dext="gif" or dext="png" then

if (i mod lie)=0 then fto.writeline "    

"+chr(13)+chr(10)

i=i+1

fto.writeline "

"

'用于排错

'fto.writeline "123"

fto.writeline imgtotable(demo,fpar,dext)

fto.writeline "

"+chr(13)+chr(10)

if (i mod lie)=0 then i=0:fto.writeline "    

"+chr(13)+chr(10)

end if

next

fto.close

response.write "

"

response.write ""&fpo&fpath&"\运行结果.doc""生成完毕。
"

set fto=nothing

end function

set fso=server.createobject("scripting.filesystemobject")

set fpo=fso.getfolder(server.mappath("./"))

for each demo in fpo.subfolders

call imagetodoc(demo,"")

next

set fpo=nothing

set fso=nothing

%>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值