VBS相册生成脚本[

2019-01-15 15:09:35王振洲

    dim htmlstr
    htmlstr = tmphtml

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set fout = fso.CreateTextFile(cpath&name,true,false)
    fout.WriteLine htmlstr
    fout.close
    set fso = nothing
    if err<>0 then
        msgbox "creatfile 出错了:" & err.description
        err.clear
    end if
end sub

Class qswhImg
dim aso
Private Sub Class_Initialize
    set aso=CreateObject("Adodb.Stream")
    aso.Mode=3 
    aso.Type=1 
    aso.Open 
End Sub
Private Sub Class_Terminate
    set aso=nothing
End Sub

Private Function Bin2Str(Bin)
    Dim I, Str
    For I=1 to LenB(Bin)
        clow=MidB(Bin,I,1)
        if ASCB(clow)<128 then
            Str = Str & Chr(ASCB(clow))
        else
            I=I+1
            if I <= LenB(Bin) then Str = Str & Chr(ASCW(MidB(Bin,I,1)&clow))
        end if
    Next 
    Bin2Str = Str
End Function

Private Function Num2Str(num,base,lens)
    'qiushuiwuhen (2002-8-12)
    dim ret
    ret = ""
    while(num>=base)
        ret = (num mod base) & ret
        num = (num - num mod base)/base
    wend
    Num2Str = right(string(lens,"0") & num & ret,lens)
End Function

Private Function Str2Num(str,base)
    'qiushuiwuhen (2002-8-12)
    dim ret
    ret = 0
    for i=1 to len(str)
        ret = ret *base + cint(mid(str,i,1))
    next
    Str2Num=ret
End Function