-- 作者:sunion
-- 发布时间:2021/8/8 18:09:00
-- [求助]向高手请教缩略图预览时的疑惑,感谢
此主题相关图片如下:微信截图_20210808180541.png
Select
Case e.Path
Case
"test.htm" Dim wb As New weui wb.AddForm("","form1","test.htm") With wb.AddInputGroup("form1","ipg1","客户资料") .AddInput("姓名","姓名","text").value = "舒淇" .AddInput("年龄","年龄","text").Value = "28" .AddInput("日期","日期","date").value = #10/12/2012# With .AddUploader("up1","",True) .AllowAdd = False
\'关闭文件上传功能 .AddImage("./images/001.jpg") .AddImage("./images/002.jpg") .AddImage("./images/003.jpg") End
With
End
With e.WriteString(wb.Build) \'生成网页 End
Select
注意黄色部分的代码,这里是3个图,所以图片预览页面应该是3个图。 那如果我要是已经上传4个图,那代码就要对应改成:
.AddImage("./images/shuqi1.jpg") .AddImage("./images/shuqi2.jpg") .AddImage("./images/shuqi3.jpg") .AddImage("./images/shuqi4.jpg")
我的疑惑,有没有办法从表A的照片列中直接获取实际上传图片的数量及图片名称?在 .AddImage("./images/。。。。。。。")里面动态调用? 比如从表A照片列的 db(0)("照片”)中获取? .......
Dim db As List(of DataRow) = DataTables("员工").SQLSelect("",3,"时间 desc ") ........
.AddImage("./images/照片1名称.jpg") .AddImage("./images/照片2名称.jpg") .AddImage("./images/照片3名称.jpg") .......
依次类推。如果表A的照片列里面已经存在几个照片,则有几个 .AddImage
我上传图片时的命名规则是:
Dim n As String = Format(Date.Now,"yyyyMMddHHmmssffff") & fln e.SaveFile(key, fln, ProjectPath & "Attachments\\" & n)
[此贴子已经被作者于2021/8/8 19:22:40编辑过]
|