Foxtable(狐表)用户栏目专家坐堂 → e.writestring


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

主题:e.writestring

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


加好友 发短信
等级:幼狐 帖子:150 积分:1969 威望:0 精华:0 注册:2017/2/19 9:09:00
e.writestring  发帖心情 Post By:2020/7/10 22:03:00 [只看该作者]

        If FileSys.FileExists(ProjectPath & "anquanshigu.foxhtm")
            htm1 = FileSys.ReadAllText(ProjectPath & "anquanshigu.foxhtm")
            e.WriteString(htm1)
        End If

老师:当htm1文本内容达到60kb以上时,手机第一次能打开页面,第二次以后就不行了,不知怎么回事?
[此贴子已经被作者于2020/7/10 22:07:02编辑过]

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


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

贴出这个代码所在的完整代码。贴出httprequest的完整代码

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


加好友 发短信
等级:幼狐 帖子:150 积分:1969 威望:0 精华:0 注册:2017/2/19 9:09:00
  发帖心情 Post By:2020/7/11 13:45:00 [只看该作者]

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

 

 

    Case "shiguanli.htm"
        Dim   htm1 As String
        If FileSys.FileExists(ProjectPath & "anquanshigu.foxhtm")
            htm1 = FileSys.ReadAllText(ProjectPath & "anquanshigu.foxhtm")
            e.WriteString(htm1)
        End If

 

 

 

老师:企业微信在电脑上登录打开成功的概率高一些,在手机上测试成功的概率低很多。很不稳定。


 

[此贴子已经被作者于2020/7/11 14:07:39编辑过]

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


加好友 发短信
等级:幼狐 帖子:150 积分:1969 威望:0 精华:0 注册:2017/2/19 9:09:00
  发帖心情 Post By:2020/7/11 13:51:00 [只看该作者]

 Case "shiguanli.htm"
        Dim   htm1 As String
        If FileSys.FileExists(ProjectPath & "anquanshigu.foxhtm")
            htm1 = FileSys.ReadAllText(ProjectPath & "anquanshigu.foxhtm")
            e.WriteString(htm1)
        End If

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


加好友 发短信
等级:超级版主 帖子:106097 积分:539590 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/7/11 14:26:00 [只看该作者]

我测试没有问题!贴出这个代码所在的完整代码。贴出httprequest的完整代码。

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


加好友 发短信
等级:幼狐 帖子:150 积分:1969 威望:0 精华:0 注册:2017/2/19 9:09:00
  发帖心情 Post By:2020/7/11 15:49:00 [只看该作者]

通过九宫格链接过去的:

Dim Val2 As Integer = Rand.Next(10000)

With wb.AddGrid("page2_1", "g2")
.Add("c8","事故案例","./she.png","http://sxwytx.iego.cn/shiguanli.htm?v=" & Val2 )
End With

 

 

这是httprequest的代码:

 

Dim fl As String = "d:\web\" & e.path
Dim path As String = fl.replace("d:\web\","")
If FileSys.FileExists(path) Then
    e.WriteFile(path)
End If

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",".txt"
            e.WriteFile(fl)
            Return '这里必须返回
    End Select
End If
Dim wb As New WeUI
Dim cmd As new SQLCommand
Dim DeviceId As String
Dim Verified  As Boolean
Dim UserId As String
Dim sb As New StringBuilder

If UserId  > ""  Then
    Verified  = True
    e.AppendCookie("userid",UserId) '将userid和username存储在Cookie中
ElseIf e.GetValues.ContainsKey("code") = False Then '如果授权失败,且不是通过授权链接跳转而来,那么就跳转到授权链接
    Dim ul As String
    If  e.GetValues("qt") = 2  Then   '判断取题是考试题还是练习题,有qt为考试题
        ul = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww51c9a9c0c93a7d18&redirect_uri=http%3a%2f%2f" & _
        "sxwytx.iego.cn%2ftest%2fmain.htm%3fqt%3d2&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
    ElseIf  e.GetValues("qt") = 1   '取练习题
        ul  = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww51c9a9c0c93a7d18&redirect_uri=http%3a%2f%2f" & _
        "sxwytx.iego.cn%2ftest%2fmain.htm&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
    ElseIf e.GetValues.ContainsKey("qt") = False Then
        Dim ul1 As String = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={0}&redirect_uri={1}&response_type=code&scope=snsapi_base&state={2}#wechat_redirect"
        Dim ul2 As String = UrlEncode("http://sxwytx.iego.cn/" & e.path)
        ul = CExp(ul1,"ww51c9a9c0c93a7d18",ul2,"123")
    End If
    sb.Append("<meta http-equiv='Refresh' c>") '跳转到授权链接
    e.WriteString(sb.ToString)
    Return
End If


Select Case e.Path
    Case "shiguanli.htm"
        Dim   htm1 As String
        If FileSys.FileExists(ProjectPath & "anquanshigu.foxhtm")
            htm1 = FileSys.ReadAllText(ProjectPath & "anquanshigu.foxhtm")
            e.WriteString(htm1)
        End If
End Select

 

 

 

 

 

 

[此贴子已经被作者于2020/7/11 15:49:20编辑过]

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


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

请上传实例说明问题

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


加好友 发短信
等级:幼狐 帖子:150 积分:1969 威望:0 精华:0 注册:2017/2/19 9:09:00
  发帖心情 Post By:2020/7/11 16:18:00 [只看该作者]

Select Case e.Path
    Case "shiguanli.htm"
        Dim   htm1 As String
        If FileSys.FileExists(ProjectPath & "anquanshigu.foxhtm")
            htm1 = FileSys.ReadAllText(ProjectPath & "anquanshigu.foxhtm")
            e.WriteString(htm1)

            return
        End If
End Select

 

 

老师:我在这里加了return后好了,可能是没有加return别的地方干扰的吧。


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


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

所以让您发完整代码。不然没法查看问题

 回到顶部