以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- net代码 需要什么样的命名空间 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=184588) |
-- 作者:tianhao0817 -- 发布时间:2022/12/14 17:14:00 -- net代码 需要什么样的命名空间 老师麻烦看一下,下面的代码保存到全局代码里,保存不了 Public Function CreateSign(ByVal filePath As String, ByVal body As String, ByVal method As String, ByVal url As String) As String Dim seconds As String = (DateTime.Now - DateTime.Parse("1970-01-01 08:00:00")).TotalSeconds.ToString().Split("."c)(0) Dim randoms As String = New Random().[Next]().ToString("X") + New Random().[Next]().ToString("X") Dim s As String = String.Format("{0}" & vbLf & "{1}" & vbLf & "{2}" & vbLf & "{3}" & vbLf & "{4}" & vbLf, method, url, seconds, randoms, body) s = Encryption.SHA256WithRSA(filePath, WeChatKey.mch_id, s) Dim sign As String = String.Format("WECHATPAY2-SHA256-RSA2048 mchid=""{0}"",n",serial_no=""{2}"",timestamp=""{3}"",signature=""{4}""", WeChatKey.mch_id, randoms, WeChatKey.certnum, seconds, s) Return sign End Function |
-- 作者:有点蓝 -- 发布时间:2022/12/14 17:26:00 -- 看源码,或者到微软msdn查询。.net命名空间成千上万个,没有人去记这个东西 |