Foxtable(狐表)用户栏目专家坐堂 → 网络服务问题


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

主题:网络服务问题

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


加好友 发短信
等级:四尾狐 帖子:855 积分:6402 威望:0 精华:0 注册:2017/11/21 21:31:00
网络服务问题  发帖心情 Post By:2020/10/16 2:20:00 [只看该作者]

网络服务设置:
HttpServer.Prefixes.Add("http://127.0.0.1:8080/")
HttpServer.WebPath = "d:\web" '指定静态文件存储位置
HttpServer.Start()

test.htm 如下:
<HTML>
<HEAD>
<meta http-equiv="Content-Type" c/>

<meta http-equiv="X-UA-Compatible" c>
<meta http-equiv="X-UA-Compatible" c >

<TITLE>测试</TITLE>
</HEAD>
<BODY >
<form action='accept.htm' enctype='multipart/form-data' method='post' id='form1' name='form1'>
<input type='text'  name="sfzhm" id="sfzhm" />
<input type='submit' name='sumbit' id='sumbit' value='提交'>
<input type='reset' name='reset' id='reset' value='重置'>
<form/>
</BODY>
</HTML>

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",".doc",".docx",".xls",".xlsx",".pdf"
         
            e.WriteFile(fl)
    End Select

End If
Select Case e.Path


       Case "accept.htm"
        Dim sb As New StringBuilder
        sb.AppendLine("接收到的数据有:<br/><br/>")
        For Each key As String In e.Values.Keys
            sb.AppendLine(key & ":" & e.Values(key) & "<br/>")
             Next
        Dim dr As DataRow = DataTables("表A").AddNew()
        dr("身份证号码")=e.postvalues("sfzhm")
        e.WriteString("读入成功  " & sb.ToString)
End Select
直接在本机点击打开网页test.htm 运行正常
设置窗口和打开网页按钮
窗口按钮代码如下:
Dim brw As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")

brw.Address ="d:\web\test.htm"

但,点击按钮后,test.htm网页打开正常,但点击提交后,得到的结果是 网页无法打开(估计是accept.htm无法打开) 是和原因?如何解决?谢谢!


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


加好友 发短信
等级:超级版主 帖子:107440 积分:546479 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/10/16 8:50:00 [只看该作者]

brw.Address ="http://127.0.0.1:8080/test.htm"

另外如果使用了HttpServer.WebPath,事件头代码可以去掉:http://www.foxtable.com/mobilehelp/topics/0276.htm

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


加好友 发短信
等级:四尾狐 帖子:855 积分:6402 威望:0 精华:0 注册:2017/11/21 21:31:00
  发帖心情 Post By:2020/10/16 14:55:00 [只看该作者]

谢谢!

 回到顶部