Select Case e.Path
Case "AddNew.htm"
If e.PostValues.Count = 0 Then
Dim sb As New StringBuilder
sb.AppendLine("<form action='AddNew.htm' enctype='multipart/form-data' method='post' id='form1' name='form1'>")
sb.AppendLine("姓名: <input name='xm' id='xm'><br/><br/>")
sb.AppendLine("年龄: <input name='nl' id='nl'><br/><br/>")
sb.AppendLine("职业: <input name='zy' id='zy'><br/><br/>")
sb.AppendLine("身高: <input type='float' name='sg' id='sg'><br/>cm<br/>")
sb.AppendLine("体重: <input type='float' name='tz' id='tz' min='0' max='300' step='1'><br/>kg<br/>")
sb.AppendLine("日期: <input type='date' name='rq' id='rq'><br/><br/>")
sb.AppendLine("<input Type='submit' name='Sumbit' id='Sumbit' value='确定'>")
sb.AppendLine("</form>")
e.WriteString(sb.ToString)
Else
Dim dr As DataRow = DataTables("会员花名册").SQLAddNew()
Dim inms() As String = {"xm","nl","zy","sg","tz","hy","rq"} '输入框名称数组
Dim cnms() As String = {"姓名","年龄","职业","身高","体重","日期"} '列名数组,注意列名和输入框必须一一对应,位置不能错乱
For i As Integer = 0 To inms.Length -1
dr(cnms(i)) = e.PostValues(Inms(i))
Next
dr.Save() '用SQLAddNew增加的行,必须保存一下,否则会被丢弃.
Dim sb As New StringBuilder
sb.AppendLine("增加订单成功! <br/><br/>")
sb.AppendLine("<a href='AddNew.htm'>继续增加</a>")
e.WriteString(sb.ToString)
End If
End Select
出现错误提示:
.NET Framework 版本:2.0.50727.8922
Foxtable 版本:2018.10.9.1
错误所在事件:项目,HttpRequest
详细错误信息:
索引超出了数组界限。