Foxtable(狐表)用户栏目专家坐堂 → 动态函数问题


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

主题:动态函数问题

帅哥哟,离线,有人找我吗?
狐表(小白)
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:371 积分:4017 威望:0 精华:0 注册:2019/9/17 10:06:00
动态函数问题  发帖心情 Post By:2021/11/22 19:09:00 [显示全部帖子]

新增一个动态函数,编译时执行的下面加色出错,如图:怎么修改拼接符?

图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看

Dim Code As string
Code = "Static CreateTime As Date" & vbcrlf
Code = Code & "Static Ticket As String" & vbcrlf
Code = Code & "Dim tp As TimeSpan = Date.Now - CreateTime" & vbcrlf 
Code = Code & "Dim ul As String = "https://qyapi.weixin.qq.com/cgi-bin/get_jsapi_ticket?access_token={0}"" & vbcrlf 
Code = Code & "If tp.TotalSeconds > 3600 Then" & vbcrlf
Code = Code & "Dim hc As New HttpClient(CExp(ul,Functions.Execute("GetQYAccessToken")))" & vbcrlf
Code = Code & "Dim ret As String = hc.GetData()" & vbcrlf
Code = Code & "If ret = "" Then" & vbcrlf
Code = Code & "hc.GetData()" & vbcrlf 
Code = Code & "End If" & vbcrlf
Code = Code & "CreateTime = Date.Now()" & vbcrlf
Code = Code & "Dim jo As JObject = JObject.Parse(ret)" & vbcrlf 
Code = Code & "If jo("errcode") = "0" Then" & vbcrlf
Code = Code & "Ticket = jo("ticket")" & vbcrlf
Code = Code & "Else" & vbcrlf 
Code = Code & "MessageBox.show("获取jsapi_ticket,原因:" & vbcrlf & jo.ToString)" & vbcrlf
Code = Code & "End If" & vbcrlf
Code = Code & "End If" & vbcrlf
Code = Code & "Dim signature As String = CExp("jsapi_ticket={0}&noncestr={1}&timestamp={2}&url={3}",Ticket,args(0),args(1),args(2))" & vbcrlf
Code = Code & "Return Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(signature, "SHA1").ToLower()" & vbcrlf
Code = Code & "Return GetJsSignature"
Functions.Add("GetJsSignature",Code)
Functions.Complie()

 回到顶部