Foxtable(狐表)用户栏目专家坐堂 → WEB读取照片


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

主题:WEB读取照片

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


加好友 发短信
等级:六尾狐 帖子:1495 积分:12175 威望:0 精华:0 注册:2013/3/19 16:41:00
WEB读取照片  发帖心情 Post By:2020/3/13 7:54:00 [显示全部帖子]

请问老师,移动开发中如何读取图片文件。比如:存在外部表中的图片文件,是不是只有下载后才能查看?

外部表A,有一列图片列B,图片列的路径是:\学校档案\照片\文件名.*,要查看姓名是ABC的信息,如何显示照片呢。

 

[此贴子已经被作者于2020/3/13 7:55:09编辑过]

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


加好友 发短信
等级:六尾狐 帖子:1495 积分:12175 威望:0 精华:0 注册:2013/3/19 16:41:00
  发帖心情 Post By:2020/3/14 21:02:00 [显示全部帖子]

例子中都是指定的文件名,我想要从表中找出姓名是张三的记录,并显示信息和照片。

不知如何从照片列取出照片名,请老师给指导下。

 

 

  Case "zgxxzp.xls"
        wb.AddForm("","form1","zgxxzp.xls")
        With wb.AddInputGroup("form1","ipg1","数据筛选")
            .AddInput("姓名","姓名","text")
        End With
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "确定", "submit")
        End With
        Dim flt As String
        If e.PostValues.ContainsKey("product") Then
            flt = "姓名 = '" & e.PostValues("姓名") & "'"
        End If
        Dim cmd As new SQLCommand
        cmd.C
        wb.AddForm("","form1","test.htm")
        With wb.AddInputGroup("form1","ipg1","客户资料")
            .AddInput("姓名","姓名","text").value = "舒淇"
            .AddInput("性别","性别","text").Value = "蒙古草原"
            .AddInput("出生日期","出生日期","date").value = #10/12/2012#
            With .AddUploader("up1","",True)
                .AllowAdd = False '关闭文件上传功能
                .AddImage("./images/001.jpg")
            End With
        End With
        e.WriteString(wb.Build) '生成网页


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


加好友 发短信
等级:六尾狐 帖子:1495 积分:12175 威望:0 精华:0 注册:2013/3/19 16:41:00
  发帖心情 Post By:2020/3/15 21:46:00 [显示全部帖子]

老师您好,把照片文件放在D:\web\夹下也是可以的,把数据表图片列重新设置即可。

我想通过查询找出一条记录,将这条记录信息和照片显示出来。

怎么做到找到这条记录并显示出来呢。


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


加好友 发短信
等级:六尾狐 帖子:1495 积分:12175 威望:0 精华:0 注册:2013/3/19 16:41:00
  发帖心情 Post By:2020/3/16 16:28:00 [显示全部帖子]

 对信息的传递搞不清楚

 

Dim wb As New weui
        wb.AddForm("","form1","test.htm")
        With wb.AddInputGroup("form1","ipg1","登录")
            .AddInput("xm","姓名","text")
               End With
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "确定", "submit")
        End With
        e.WriteString(wb.Build) '生成网页


‘’’按姓名查找

Dim dr As DataRow

 dr = DataTables("职工信息总表").SQLFind("姓名 = '怎么把我要查找的内容传递到这里'")

 If dr  IsNot Nothing Then  '如果找到的话

    Output.Show("日期:" & dr("姓名"))

  End If



‘’’显示照片


Dim fl As String = "d:\web\" & e.path
If filesys.FileExists(fl)
    Dim idx As Integer = fl.LastIndexOf(".")
    Dim ext As String  = fl.SubString(idx)
    Select Case ext
        Case ".jpg",".gif",".png",".bmp",".wmf"
            e.WriteFile(fl)
    End Select
Else
    Dim sb As New StringBuilder
    sb.Appendline("我想显示一个图片<br/><br/>")
               sb.AppendLine("<img src='/images/照片名怎么从找到的记录的照片列提出来'>")
         e.WriteString(sb.ToString())
End If

[此贴子已经被作者于2020/3/16 16:28:49编辑过]

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


加好友 发短信
等级:六尾狐 帖子:1495 积分:12175 威望:0 精华:0 注册:2013/3/19 16:41:00
  发帖心情 Post By:2020/3/16 18:49:00 [显示全部帖子]

老师您好,下面的代码能够连接到页面,但什么也不显示。请看看问题出哪了。

 

 

 Case "zgxxzp.htm"
        Dim name As String
        If e.PostValues.ContainsKey("xm") Then
            name = e.PostValues("xm")
        End If
        'Dim wb1 As New weui                                      ’前面已定义过了
        'wb .AddForm("","form1","test.htm")
        With wb.AddInputGroup("form1","ipg1","登录")
            .AddInput("xm","姓名","text").value = name
        End With
        Dim dr As DataRow
        If name > "" Then
            dr = DataTables("职工信息总表").SQLFind("姓名 = '" & name  & "'")
        End If
       
        If dr  IsNot Nothing Then  '如果找到的话
            With wb.AddInputGroup("form1","ipg1","客户资料")
                .AddInput("姓名","姓名","text").value = "姓名"
                .AddInput("性别","性别","text").Value = "性别"
                .AddInput("任教学科","任教学科","text").value = "任教学科"
                With .AddUploader("up1","",True)
                    .AllowAdd = False '关闭文件上传功能
                    .AddImage("./试验/" & dr("图片"))
                End With
            End With
        End If
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "确定", "submit")
        End With
        e.WriteString(wb.Build) '生成网页


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


加好友 发短信
等级:六尾狐 帖子:1495 积分:12175 威望:0 精华:0 注册:2013/3/19 16:41:00
  发帖心情 Post By:2020/3/16 19:53:00 [显示全部帖子]

老师您好,我改成下面这样:

Case "zgxxzp.htm"
        Dim name As String
        wb.AddForm("","form2","zgxxzp.htm")
        With wb.AddInputGroup("form2","ipg2","教师职称查询")
            .Addinput("xm","姓名","text")
        End With
        With wb.AddButtonGroup("form2","btg2",True)
            .Add("btn2", "确定", "submit")
        End With
        If e.PostValues.ContainsKey("xm") Then
            name = e.PostValues("xm")
            MessageBox.show("我生成的页面内容:" & e.PostValues("xm"))      ’到这里正确
        End If
        MessageBox.show("我生成的页面内容:" & name)                              ‘到这里也正确
        'Dim wb1 As New weui
        'wb .AddForm("","form1","test.htm")
        ' With wb.AddInputGroup("form1","ipg1","登录")
        '    .AddInput("xm","姓名","text").value = name
        'End With

 

’下面的代码没执行,页面没反应        

        Dim dr As DataRow
        If name > "" Then
            dr = DataTables("职工信息总表").SQLFind("姓名 = '" & name  & "'")
        End If
       
        If dr  IsNot Nothing Then  '如果找到的话
            With wb.AddInputGroup("form1","ipg1","客户资料")
                .AddInput("姓名","姓名","text").value = "姓名"
                .AddInput("性别","性别","text").Value = "性别"
                .AddInput("任教学科","任教学科","text").value = "任教学科"
                With .AddUploader("up1","",True)
                    .AllowAdd = False '关闭文件上传功能
                    .AddImage("D:\web\试验\" & dr("照片"))
                End With
            End With
        End If
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "确定", "submit")
        End With
        e.WriteString(wb.Build) '生成网页
       
       
End Select
e.WriteString(wb.Build)


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


加好友 发短信
等级:六尾狐 帖子:1495 积分:12175 威望:0 精华:0 注册:2013/3/19 16:41:00
  发帖心情 Post By:2020/3/16 20:54:00 [显示全部帖子]

   Case "zgxxzp.htm"
        Dim name As String
        wb.AddForm("","form2","zgxxzp.htm")
        With wb.AddInputGroup("form2","ipg2","教师职称查询")
            .Addinput("xm","姓名","text")
        End With
        With wb.AddButtonGroup("form2","btg2",True)
            .Add("btn2", "确定", "submit")
        End With
        If e.PostValues.ContainsKey("xm") Then
            name = e.PostValues("xm")
        End If
       
        Dim dr As DataRow
        ' msgbox(name)
        If name > "" Then
            dr = DataTables("职工信息总表").SQLFind("姓名 ='" & name  & "'")
        End If
       
        If dr  IsNot Nothing Then  '如果找到的话
            msgbox(name )           '到这里name也是正确的,但直接就返回到输入页面了。
            

下面的代码为什么不执行呢?
            With wb.AddInputGroup("form1","ipg1","职工信息")
                .AddInput("姓名","姓名","text").value = "姓名"
                .AddInput("性别","性别","text").Value = "性别"
                .AddInput("任教学科","任教学科","text").value = "任教学科"
                With .AddUploader("up1","",True)
                    .AllowAdd = False '关闭文件上传功能
                    .AddImage("D:\web\试验\" & dr("照片"))
                End With
            End With
        End If
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "确定", "submit")
        End With
        e.WriteString(wb.Build) '生成网页
        Return


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


加好友 发短信
等级:六尾狐 帖子:1495 积分:12175 威望:0 精华:0 注册:2013/3/19 16:41:00
  发帖心情 Post By:2020/3/16 21:24:00 [显示全部帖子]

好了,谢谢老师了。

 回到顶部