以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  WEB读取照片  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=147274)

--  作者:nxqtxwz
--  发布时间:2020/3/13 7:54:00
--  WEB读取照片

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

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

 

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

--  作者:有点蓝
--  发布时间:2020/3/13 8:48:00
--  
参考:http://www.foxtable.com/mobilehelp/topics/0044.htm
--  作者:nxqtxwz
--  发布时间: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) \'生成网页


--  作者:有点蓝
--  发布时间:2020/3/15 20:15:00
--  
从表格找一行数据是很容易的,foxtable有N多种方法。2楼的帮助是为了告诉您,文件必须在web的目录里才能读取:
HttpServer.WebPath = "d:\\web"  \'指定静态文件存储位置

如果【图片列的路径是:\\学校档案\\照片\\文件名.*】不这些路径不在"d:\\web"里面,是没有办法的

--  作者:nxqtxwz
--  发布时间:2020/3/15 21:46:00
--  

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

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

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


--  作者:有点蓝
--  发布时间:2020/3/15 23:34:00
--  
参考:http://www.foxtable.com/webhelp/topics/2911.htm
--  作者:nxqtxwz
--  发布时间: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编辑过]

--  作者:有点蓝
--  发布时间:2020/3/16 16:37:00
--  
dim name as string
if e.PostValues.ContainsKey("xm") then
name = e.PostValues("xm")
end if
Dim wb 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 .AddUploader("up1","",True)
                .AllowAdd = False \'关闭文件上传功能
                .AddImage("." & dr("图片"))
            End With

else
            With .AddUploader("up1","",True)
                .AllowAdd = False \'关闭文件上传功能
            End With
end if
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "确定", "submit")
        End With
        e.WriteString(wb.Build) \'生成网页

输入姓名后点击确定按钮提交看效果
[此贴子已经被作者于2020/3/16 16:43:28编辑过]

--  作者:nxqtxwz
--  发布时间: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
--  发布时间: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)