Dim e As RequestEventArgs = args(0)
Dim wb As New weui
Select Case e.Path
Case "yanfacpdata"
If e.PostValues.Count = 0 Then
wb.AddForm("", "form1", "yanfacpdata")
With wb.AddInputGroup("form1", "ipg1", "增加员工")
.AddUploader("up1", "照片", True) 'True表示允许上传多个文件
End With
With wb.AddButtonGroup("form1", "btg1", True)
.Add("btn1", "确定", "submit")
End With
MessageBox.show(1)
' e.WriteString(wb.Build)
Else
MessageBox.show(2)
For Each key As String In e.Files.Keys
If key = "up1" Then
For Each fln As String In e.Files(key)
e.SaveFile(key, fln, ProjectPath & "Attachments\" & fln)
Next
End If
Next
'保存并生成增加成功提示页面
With wb.AddMsgPage("", "msgpage", "增加成功", "好好学习,天天向上") '生成成功提示页
.AddButton("btn1", "继续增加", "yanfacpdata")
End With
End If
e.WriteString(wb.Build)
End Select
If e.PostValues.Count = 0 Then改为
If e.PostValues.Count = 0 andalso e.Files.Keys.count = 0 Then
---------------------------
---------------------------
System.Collections.Generic.List`1[System.String]
---------------------------
确定
---------------------------
点击确定后报错
Dim wb As New weui
Select Case e.Path
Case "yanfacpdata"
If e.PostValues.Count = 0 AndAlso e.Files.Keys.count = 0 Then
'
wb.AddForm("", "form1", "yanfacpdata")
With wb.AddInputGroup("form1", "ipg1", "增加员工")
.AddUploader("up1", "照片", True) 'True表示允许上传多个文件
End With
With wb.AddButtonGroup("form1", "btg1", True)
.Add("btn1", "确定", "submit")
End With
' MessageBox.show(1)
e.WriteString(wb.Build)
Else
' MessageBox.show(2)
For Each key As String In e.Files.Keys
If key = "up1" Then
For Each fln As String In e.Files(key)
e.SaveFile(key, fln, "E:\www\JKMJ-layui\pic\cptp\" & fln)
MessageBox.show((e.Files(key)).ToString)
Next
End If
Next
'保存并生成增加成功提示页面
With wb.AddMsgPage("", "msgpage", "增加成功", "好好学习,天天向上") '生成成功提示页
.AddButton("btn1", "继续增加", "yanfacpdata")
End With
e.WriteString(wb.Build)
End If
End Select
这个代码我测试没有问题,应该是其它地方代码问题
[此贴子已经被作者于2024/1/15 17:23:26编辑过]