Foxtable(狐表)用户栏目专家坐堂 → 调用的目标发生了异常。


  共有2503人关注过本帖树形打印复制链接

主题:调用的目标发生了异常。

帅哥哟,离线,有人找我吗?
刘林
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1942 积分:14925 威望:0 精华:0 注册:2016/4/28 9:58:00
调用的目标发生了异常。  发帖心情 Post By:2018/9/25 17:15:00 [只看该作者]

Dim e As RequestEventArgs = args(0)
Dim wb As New  weui
Dim dr As DataRow = DataTables("用户").sqlfind("身份证号='" & e.Cookies("username") & "'")
wb.InsertHTML("<!DOCTYPE html>")
wb.InsertHTML("<html>")
wb.InsertHTML("<head>")
wb.InsertHTML("<meta charset='utf-8'>")
wb.InsertHTML("<meta name='viewport' c />")
wb.InsertHTML("<title></title>")
wb.InsertHTML("<script src='../mui/js/mui.min.js'></script>")
wb.InsertHTML("<link href='../mui/css/mui.css' rel='stylesheet'/>")
wb.InsertHTML("<script Type='text/javascript' charset='utf-8'>mui.init();</script>")
wb.InsertHTML("</head>")
wb.InsertHTML("<body>")
wb.InsertHTML("<header class='mui-bar mui-bar-nav mui-bar-nav-bg'>")
wb.InsertHTML("<a  id='icon-menu' class='mui-action-back mui-icon mui-icon-left-nav mui-pull-left'></a>")
wb.InsertHTML("<h1 class='mui-title'>密码修改</h1>")
wb.InsertHTML("</header>")
wb.InsertHTML("<div class='mui-content'>")
wb.InsertHTML("<br>")
If e.PostValues.Count = 0 Then
    wb.AddForm("","form1","xgmm.htm")
    With wb.AddInputGroup("form1","ipg1")
        Dim idfm = .AddInput("username","用户名:","text")
        idfm.value= e.Cookies("username")
        idfm.readonly = True
        Idfm.attribute="style= 'border:none;padding:0px;height:30px;width:auto;margin:0;"
        Dim idxm = .AddInput("username","姓&nbsp;&nbsp;&nbsp;&nbsp;名:","text")
        idxm.value= dr("name")
        idxm.attribute="style= 'border:none;padding:0px;height:30px;width:auto;margin:0;"
        idxm.readonly = True
        Dim ymm =.AddInput("ymm","原密码:","password")
        ymm.placeholder ="请输入原密码"
        ymm.attribute="style= 'border:none;padding:0px;height:30px;width:auto;margin:0;"
        Dim xmm =.AddInput("xmm","新密码:","password")
        xmm.placeholder ="请输入6位新密码"
        xmm.attribute="style= 'border:none;padding:0px;height:30px;width:auto;margin:0;"
        
    End With
    With wb.AddButtonGroup("form1","btg1",False)
        Dim bt1=  .Add("btn1", "确定修改", "submit")
        bt1.attribute="style='border:1px solid black;border-radius:40px;padding:0px;width:50%'"
        bt1.kind=1
 
    End With
    e.WriteString(wb.Build)
Else
    If e.PostValues("ymm")<> e.Cookies("password")
        With wb.AddMsgPage("","msgpage","修改不成功", "原密码不正确!")
            .icon = "Warn" '改变图标
            Dim bt1 =.AddButton("btn1","返回")
            bt1.Attribute = " style='border:1px solid black;border-radius:20px;padding:0px;width:50%'"
            bt1.kind=1
        End With
        e.WriteString(wb.Build)
        Return ""
    End If
    If  e.PostValues("xmm").length<>6
        With wb.AddMsgPage("","msgpage","修改不成功", "新密码统一要求应为六位")
            .icon = "Warn" '改变图标
            Dim bt1= .AddButton("btn1","返回")
            bt1.Attribute = " style='border:1px solid black;border-radius:20px;padding:0px;width:50%'"
            bt1.kind=1
        End With
        e.WriteString(wb.Build)
        Return ""
    End If
    dr("password")=e.PostValues("xmm")
    wb.AppendCookie("password",e.postvalues("xmm"))
    dr.save()
    With wb.AddMsgPage("","msgpage","密码改成为", "请记住你修改的新密码为:" & e.postvalues("xmm")) '生成成功提示页
        Dim bt6= .AddButton("btn6","返回","javascript:history.back()")
        bt6.Attribute = "style='border:1px solid black;border-radius:20px;padding:0px;width:50%'"
        bt6.kind=1
    End With
    
End If
wb.InsertHTML("form1","</div>")
wb.InsertHTML("<script src='../mui/js/mui.min.js'></script>")
wb.InsertHTML("<link href='../mui/css/mui.css' rel='stylesheet'/>")
wb.InsertHTML("<script Type='text/javascript' charset='utf-8'>mui.init();</script>")
e.WriteString(wb.Build)


老师,上面红色部分判断若ymm的宽度不为6,则返回,当没输入xmm时提示调用的目标发生了异常。怎么改?

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/9/25 17:48:00 [只看该作者]

If  e.PostValues("xmm").length<>6

 

改成

 

If e.PostValues("xmm") = Nothing OrElse e.PostValues("xmm").length<>6 Then


 回到顶部
帅哥哟,离线,有人找我吗?
刘林
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1942 积分:14925 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2018/9/25 18:45:00 [只看该作者]

哦,可以了,谢谢

 回到顶部