-- 作者:有点甜
-- 发布时间:2018/3/21 13:19:00
--
写成循环即可。循环每一行,然后添加。
Dim fl As String = "c:\\web\\" & e.path \'合成含路径的文件名 If filesys.FileExists(fl) Dim idx As Integer = fl.LastIndexOf(".") Dim ext As String = fl.SubString(idx) Select Case ext Case ".jpg",".gif",".png",".bmp",".wmf",".js",".htm",".html",".css",".zip",".rar" \'这里加上了js扩展名 e.WriteFile(fl) Return \'这里必须返回 End Select End If
Select Case e.Path Case "test.htm", "" Dim wb As New weui Dim drs = DataTables("表A").Select("") For i As Integer = 0 To drs.count-1 Dim dr = drs(i) If i > 0 Then wb.AddPage("","page" & i, False) \'增加两个page Else wb.AddPage("","page" & i) \'增加两个page End If With wb.AddArticle("page" & i, "ar" & i) .AddTitle("h" & i, dr("第一列")) .AddContent(dr("第二列")) .AddImage("./images/" & dr("第三列")) End With If i < drs.count-1 Then With wb.AddButtonGroup("page" & i,"btg1" & i) .Add("btn1_" & i, "下一页", "button").Attribute="onclick=""hide(\'page" & i & "\');show(\'page" & i+1 & "\')""" End With End If If i > 0 Then With wb.AddButtonGroup("page" & i,"btg2" & i) .Add("btn2_" & i, "上一页", "button").Attribute="onclick=""hide(\'page" & i & "\');show(\'page" & i-1 & "\')""" End With End If Next e.WriteString(wb.Build) \'生成网页 End Select
|