Foxtable(狐表)用户栏目专家坐堂 → 提示信息


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

主题:提示信息

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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
提示信息  发帖心情 Post By:2018/4/7 15:31:00 [显示全部帖子]

Dim e As RequestEventArgs = args(0)
Dim ftp1 As New FtpClient
Dim wb As New weui
ftp1.Host=
ftp1.Account = 
ftp1.Password = 
Dim dr As DataRow = DataTables("中考表").sqlfind("sfzh = '" & e.Cookies("username") & "'")
Dim dr1 As DataRow = DataTables("生地报名库").SQLfind("身份证号= '" & e.Cookies("username") & "'","_identify desc")
Dim dr2 As DataRow = DataTables("学生信息").SQLfind("身份证件号= '" & e.Cookies("username") & "'","_identify desc")
Dim dr3 As DataRow = DataTables("用户").sqlfind("身份证号= '" & e.Cookies("username") & "'")
If dr Is Nothing
    dr=DataTables("中考表").addnew()
Else
    DataTables("中考表").loadfilter ="sfzh = '" & e.Cookies("username") & "'"
    DataTables("中考表").load
End If
dr("csny")= format(ReadBirthDay(e.Cookies("username")), "yyyyMMdd")
If ReadSex(e.cookies("username"))="男"
    dr("xb")=1
End If
If ReadSex(e.cookies("username"))="女"
    dr("xb")=2
End If
DR("sfzh")= e.Cookies("username")
dr("bswy")="1"
dr("kshlb")="1"
If dr3 IsNot Nothing
    dr("xxmc")= dr3("group")
End If
dr.save()
If e.PostValues.Count = 0 Then
    With wb.AddTabBar("", "tb1", 1)
        Dim a1= .AddPage("page1","中考报名","./images/21.png")
        .AddPage("page2","注意事项","./images/23.png")
        .AddPage("page3","有关通知","./images/24.png")
    End With
    wb.AddForm("page1","form1","zkbm.htm")
    With wb.AddInputGroup("form1","ipg1","用户:" & e.Cookies("username") & ",请仔细填写每项信息")
        If dr("xjh") >""
            Dim Inxjh = .AddInput("xjh","学籍号码:","text")
            Inxjh.value=dr("xjh")
            Inxjh.readonly = dr("手机锁定")
            Inxjh.Attribute="style = 'color:blue'"
        Else
            If dr1("学籍号")>""
                Dim Inxjh= .AddInput("xjh","学籍号码:","text")
                Inxjh.value=dr1("学籍号")
                Inxjh.readonly = dr("手机锁定")
                Inxjh.Attribute="style = 'color:blue'"
            Else
                Dim Inxjh=.AddInput("xjh","学籍号码:","text")
                Inxjh.value=dr2("学籍号")
                Inxjh.readonly = dr("手机锁定")
                Inxjh.Attribute="style = 'color:blue'"
            End If
        End If
        If dr("xm") >""
            Dim Inxm =.AddInput("xm","姓        名:","text")
            Inxm.value=dr("xm")
            Inxm.readonly = dr("手机锁定")
            Inxm.Attribute="style = 'color:blue'"
        Else
            If dr1("姓名")>""
                Dim Inxm =.AddInput("xm","姓        名:","text")
                Inxm.value=dr1("姓名")
                Inxm.readonly = dr("手机锁定")
                Inxm.Attribute="style = 'color:blue'"
            Else
                Dim Inxm= .AddInput("xm","姓        名:","text").value=dr2("学生姓名")
                Inxm.readonly = dr("手机锁定")
                Inxm.Attribute="style = 'color:blue'"
            End If
        End If
        
        
        wb.AppendHTML("<script type='text/javascript' src='./lib/common.js'></script>", True)
        wb.AppendHTML("<script type='text/javascript' src='./lib/camera.js'></script>")
        
        wb.InsertHTML("<img src='/xp/511011200201038010' width='50' height='50'>")
        
        With .AddUploader("up128","上传照片:",False)
            .TextPosition = 0 '标题靠左
            .AllowDelete = True '允许删除
            .ScaleWidth = 400 '自动压缩图片宽度为400个像素,高度等比例压缩
        End With
       。。。
        Dim str3 As String = " |非借考生|借考生"
        If dr.Isnull("是否借考")
            Dim Insfjk= .AddSelect("是否借考","是否借考:",str3)
            Insfjk.enabled= not dr("手机锁定")
            Insfjk.Attribute="style = 'color:red'"
        Else
            Dim Insfjk= .AddSelect("是否借考","是否借考:",str3.replace(dr("是否借考"), "[" & dr("是否借考") & "]"))
            Insfjk.enabled= not dr("手机锁定")
            Insfjk.Attribute="style = 'color:red'"
        End If
    End With
    With wb.AddButtonGroup("form1","btg1")
        .Add("btn1", "保存", "submit")
        .Add("btn2", "锁定", "button").Attribute = ""
        .Add("btn3", "退出", "button").Attribute = ""
    End With
    With wb.AddPanelGroup("page2","pg1","注意事项")
        '待加...
    End With
    wb.AppendHTML("<script src='./lib/order.js'></script>") '引入
    e.WriteString(wb.Build) '生成网

If e.GetValues.ContainsKey("lock") Then   '如果地址中有page参数
    Dim zds() As String = {"xm","lxdh","txdz","sdbmh","政治面貌","民族","考生类别","户口性质","综合素质","是否借考","bxxjnx","bjdm","yzbm"} '不能为空的列名数组
    For Each zd As String In zds
        If dr(zd)=""
            e.WriteString(wb.Build)
            Return ""
            e.WriteString(wb.Build)
        End If
    Next
    dr("手机锁定")= True
    dr.save()
With wb.AddMsgPage("form1","msgpage","锁定成功数据不能再修改不能再修改", "") '生成成功提示页
        .AddButton("btn7","返回","zkbm.htm")
    End With
End If


Else
    Dim nms() As String = {"xm","lxdh","txdz","sdbmh","政治面貌","民族","考生类别","户口性质","综合素质","是否借考","bxxjnx","bjdm","yzbm"} '不能为空的列名数组
    For Each nm As String In nms
        If e.PostValues(nm) = "" Then '生成错误提示页
            With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!")
                .icon = "Warn" '改变图标
                .AddButton("btn1","返回").Attribute = ""
            End With
            e.WriteString(wb.Build)
            Return "" '必须返回
        End If
    Next
    nms = New String() {"xjh","xm","lxdh","txdz","sdbmh","政治面貌","民族","考生类别","户口性质","综合素质","是否借考","bxxjnx","bjdm","sfzh","yzbm"}  '重新定义了nms数组,增加了两列.
    For Each nm As String In nms
        If e.PostValues.ContainsKey(nm) Then
            dr(nm) = e.PostValues(nm)
        End If
    Next
    If trim(e.postvalues("是否借考"))="借考生"
        dr("jks") = "1"
    Else
        dr("jks")= Nothing
    End If
    DataTables("中考表").DataCols("政治面貌").RaiseDataColChanged()
    dr.save()
    For Each key As String In e.Files.Keys
        For Each fln As String In e.Files(key)
            e.SaveFile(key,fln,"c:\web\uploadfiles\" & fln)
            Dim ifo As new FileInfo("c:\web\uploadfiles\" & fln)
            。。。
        Next
    Next
    With wb.AddMsgPage("","msgpage","保存成功,确定无误锁定,锁定后将不能再修改", "") '生成成功提示页
        .AddButton("btn6","返回","zkbm.htm")
    End With
    wb.AppendHTML("<script src='./lib/order.js'></script>") '引入
    e.WriteString(wb.Build)
End If

老师,请问两段红色代码的问题:
1、我想这样如果有这个人的相片,在这个位置插入相片,这样写没显示出来,只在页面底部有个图框,该怎样改?
2、我为锁定键增加功能锁定,可以锁定,但想在锁定后给个提示没有出来,该怎样改?
[此贴子已经被作者于2018/4/7 15:33:28编辑过]

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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2018/4/7 16:12:00 [显示全部帖子]

老师我改了还是不行,我把整个代码发给你帮看一下
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:11.txt


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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2018/4/7 16:42:00 [显示全部帖子]

function locked(){ location="zkbm.htm?&lock=ture";}

是能锁的,现在主要问题是提示信息没出来,

Dim a1= .AddPage("page1","中考报名","./images/21.png")
        .AddPage("page2","注意事项","./images/23.png")
        .AddPage("page3","有关通知","./images/24.png")

再补个问题:,中考报名显在图片下面,21.png显示很小,如何让图片显得大点字就显在图片的中间这样呢
[此贴子已经被作者于2018/4/7 16:46:39编辑过]

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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2018/4/7 18:45:00 [显示全部帖子]

还是不行,现在点锁定还成白民屏了,之前是能锁定但不出提示信息

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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2018/4/8 14:02:00 [显示全部帖子]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:12.txt




楼上问题解决了
一直还有这个问题没解决,今天想集中解决这个问题

1、上面代码我想用up2来显示ftp上的相片,这个写法显示不出来,远程上的图片,"\xp\" & e.cookies("username") & ".jpg" 这个文件是有的
2、压缩图片上传是可以实现了,但一直不是在手机网页下可调摄像头,但打成包就不得行,请老师救我一下,确定对我很难,但又急待解决谢谢

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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2018/4/9 7:20:00 [显示全部帖子]

Dim e As RequestEventArgs = args(0)
Dim path As String = "foxtableAppTest"
Dim wb As New weui
wb.AppendHTML("<script type='text/javascript' src='/" & path & "/js/common.js'></script>", True)
wb.AddPageTitle("","xp","相片上传","近期正面规范证件照")
wb.AddForm("","form1","xpcjsave.htm")
With wb.AddInputGroup("form1","ipg1","")
    With .AddUploader("up2","我的照片",False)
        .AllowAdd = False
        .TextPosition = 0
        .AddImage("./xp/" & e.Cookies("username") & ".jpg")
    End With
    With .AddUploader("up1","最新照片",False)
        .TextPosition = 0
        .AllowDelete = True '允许删除
        .Incremental = False '允许重复选择文件或连续拍照
        '  .ScaleWidth = 400 '自动压缩图片宽度为400个像素,高度等比例压缩
    End With
End With
wb.InsertHTML("form1", "<div id='imgs'></div>")
With wb.AddButtonGroup("form1","btg1",False)
    .Add("btn1", "拍照", "button").Attribute = """
    .Add("btn1", "上传")
    .Add("btn1", "退出").Attribute = ""
End With
wb.AppendHTML("<script type='text/javascript' src='/" & path & "/js/camera.js'></script>")
e.WriteString(wb.Build)


老师,按例子改成了在Hubilder打包后可调摄像头了,还有些问题?
1、UP2我的目的是想显示已有照片,但显示出来的结果是一个正方形的图片,请问如何调整其图框大小?
2、点UP1在打包后不能调出摄像头,点拍照在打包下可调出摄像头?我这样试了up1加.Attribute = """ ,不行,如何才能实现在打包下点UP1也能调出摄像头呢
3、wb.InsertHTML("form1", "<div id='imgs'></div>"拍的的图是加在imgs里,且显示在UP2下面,页面不好看,总之是想把拍的图放在UP2里



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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2018/4/9 14:48:00 [显示全部帖子]

1、wb.InsertHTML("<img src='./xp/" & e.Cookies("username") & ".jpg' width='80' height='120'>")
试过这样,但这个图片并不是显示在我想要的位置,而是显示在页面的最底部位置

2、如果在打包下调不出摄像头,上面的代码就不要up1,imgs又何定来定位和写大小呢?


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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2018/4/9 20:43:00 [显示全部帖子]

Dim e As RequestEventArgs = args(0)
Dim path As String = "foxtableAppTest"
Dim wb As New weui
wb.AppendHTML("<script type='text/javascript' src='/" & path & "/js/common.js'></script>", True)
wb.AddPageTitle("","xp","相片上传","近期正面规范证件照")
wb.AddForm("","form1","xpcjsave.htm")

 wb.InsertHTML("form1","<div style='height: 150px'><span style='position:absolute;margin-top:60px;'>我的照片:</span><img src='./xp/" & e.Cookies("username") & ".jpg' style='height: 150px;margin-left:80px'></div>")
'wb.InsertHTML("form1", "<div id='imgs'</div>")
 wb.InsertHTML("form1","<div style='height: 150px'><span style='position:absolute;margin-top:60px;'>最新照片:</span><div id='imgs'></div></div>")
With wb.AddButtonGroup("form1","btg1",False)
    .Add("btn1", "拍照", "button").Attribute = """
    .Add("btn1", "上传")
    .Add("btn1", "退出","button").Attribute = ""
End With
wb.AppendHTML("<script type='text/javascript' src='/" & path & "/js/camera.js'></script>")
e.WriteString(wb.Build)

老师,现在是因为upload不能调整图框大小,经请教改用下面这句来显示已有相片已可以了
wb.InsertHTML("form1","<div style='height: 150px'><span style='position:absolute;margin-top:60px;'>我的照片:</span><img src='./xp/" & e.Cookies("username") & ".jpg' style='height: 150px;margin-left:80px'></div>")

现在为了实现在手机上hublider打包能调摄像头功能,要想将例子蓝色这句改进成:1、先有个如上句大小的一个边框,同样左边有个最新照片:几个字,调用摄像头取得的图像装在imags框里,有仿upload的效果,且imags框里只能取一张相,这该怎样写呢,看了css还是写不来,请帮写下,谢谢。

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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2018/4/9 21:39:00 [显示全部帖子]

wb.InsertHTML("form1", "<div id='imgs'</div>"
这个id如何加?   
因为.Add("btn1", "拍照", "button").Attribute=  getImageByCamera('imgs')          拍的图要调入里面并履盖空白图片(我可以将空白图片做一个标准相样板,照的像替换后才上传

目的就是照的像放把这个框里去
[此贴子已经被作者于2018/4/9 21:41:47编辑过]

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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2018/4/9 22:06:00 [显示全部帖子]


图片点击可在新窗口打开查看此主题相关图片如下:screenshot_2018-04-09-23-03-59-64.png
图片点击可在新窗口打开查看

现在将上面改成
Dim e As RequestEventArgs = args(0)
Dim path As String = "foxtableAppTest"
Dim wb As New weui
wb.AppendHTML("<script type='text/javascript' src='/" & path & "/js/common.js'></script>", True)
wb.AddPageTitle("","xp","相片上传","近期正面规范证件照")
wb.AddForm("","form1","xpcjsave.htm")
wb.InsertHTML("form1","<div style='height: 150px'><span style='position:absolute;margin-top:60px;margin-left:20px;'>我的照片:</span><img src='./xp/" & e.Cookies("username") & ".jpg' style='height: 150px;width:120px;margin-left:130px;max-height:100%'></div>")
wb.InsertHTML("form1","<div style='height: 150px'><span style='position:absolute;margin-top:80px;margin-left:20px;'>样板照片:</span><div id='imgs'><img src='./xp/yb.jpg' style='height:150px;width:120px;margin-top:20px;margin-left:130px;max-height:100%;'></div></div>")
With wb.AddButtonGroup("form1","btg1",False)
    .Add("btn1", "拍照", "button").Attribute = """
    .Add("btn1", "上传")
    .Add("btn1", "退出","button").Attribute = ""
End With
wb.AppendHTML("<script type='text/javascript' src='/" & path & "/js/camera.js'></script>")
e.WriteString(wb.Build)



Dim e As RequestEventArgs = args(0)
Dim wb As New  weui
Dim path As String = "foxtableAppTest"
Dim ftp1 As New FtpClient
ftp1.Host="
ftp1.Account = "
ftp1.Password = 
For Each key As String In e.PostValues.Keys
    If key.Contains("imgs_") Then
        Dim bs As Byte() = Convert.FromBase64String(e.PostValues(key).split(",")(1))
        Dim stream As System.IO.Stream = New System.IO.MemoryStream(bs)
        Dim bmp As System.Drawing.Bitmap = New System.Drawing.Bitmap(stream)
        bmp.Save("./xp/" & key & ".jpg", System.Drawing.Imaging.ImageFormat.Png)
        Dim ifo As new FileInfo("./xp/" & key & ".jpg")
        Dim img As image = getimage("./xp/" & key & ".jpg")
        Dim bmp2 As new bitmap(img.width, img.height)
        Dim g = graphics.fromimage(bmp)
        g.DrawImage(img, 0, 0, img.Width, img.Height)
        Dim jpgEncoder As ImageCodecInfo
        Dim codecs() As ImageCodecInfo = ImageCodecInfo.GetImageDecoders
        For Each codec As ImageCodecInfo In codecs
            If (codec.FormatID = ImageFormat.Jpeg.Guid) Then
                jpgEncoder = codec
                Exit For
            End If
        Next
        Dim myEncoder As System.Drawing.Imaging.Encoder = System.Drawing.Imaging.Encoder.Quality
        Dim myEncoderParameters As EncoderParameters = New EncoderParameters(1)
        Dim myEncoderParameter As EncoderParameter = New EncoderParameter(myEncoder, 10) ' 质量级别 0 对应于最大压缩,而质量级别 100 对应于最小压缩
        myEncoderParameters.Param(0) = myEncoderParameter
        Dim slt As String =  ifo.path & e.Cookies("username") & ifo.Extension
        bmp2.Save(slt,jpgEncoder, myEncoderParameters)
        bmp2.dispose
        g.dispose
        Dim img1 As image = getImage(slt)
        Dim bmp1 As bitmap
        If img1.width > 200 Then
            If 200 * (img1.height / img1.width) > 150 Then
                bmp1 = new bitmap(img1, 200*(150/(200*(img1.height/img1.width))), 150)
            Else
                bmp1 = new bitmap(img1, 150, 150 * (img1.height / img1.width))
            End If
        End If
        bmp1.save(slt)
        bmp1.Dispose
        If ftp1.Upload(slt,".\xp\" & FileSys.GetName(e.Cookies("username") & Ifo.extension),True) = True Then
        End If
    End If
Next
With wb.AddMsgPage("","msgpage","相片上传成功", "") '生成成功提示页
    .AddButton("btn1","返回","xpcj.htm")
End With
e.WriteString(wb.Build)




1、现在改成这样,后缩放实现了,但如何让图片居中呢,试了不行,另外按键与图片间间隔如何调?

2、另外提交的图片压缩成一张黑色的板色去了,之前用upload提交同样的代码压缩成20k左右,现在压缩成500K左右,关键成了黑板,不晓得哪里改错了
[此贴子已经被作者于2018/4/9 23:05:40编辑过]

 回到顶部
总数 16 1 2 下一页