Foxtable(狐表)用户栏目专家坐堂 → [求助]如何制作图片服务器


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

主题:[求助]如何制作图片服务器

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


加好友 发短信
等级:超级版主 帖子:111393 积分:567029 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/6/23 22:50:00 [显示全部帖子]

图片使用网络路径即可,比如默认服务为80端口:

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",".js",".css" ,".html",".htm",".zip",".rar"
            e.WriteFile(fl)
            Return '这里必须返回
    End Select
End If
Select Case e.Path
    Case "test.htm"
        Dim wb As New weui
        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("http://127.0.0.1:20200/images/001.jpg")
                .AddImage("http://127.0.0.1:20200/images/002.jpg")
                .AddImage("http://127.0.0.1:20200/images/003.jpg")
            End With
        End With
        e.WriteString(wb.Build) '生成网页
End Select

增加一个服务端,使用其它端口启动
HttpServer.Prefixes.Add("http://127.0.0.1:20200/")
HttpServer
.Start()

HttpRequest代码:
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",".js",".css" ,".html",".htm",".zip",".rar"
            e.WriteFile(fl)
            Return '这里必须返回
    End Select
End If


 回到顶部