老师麻烦看一下,下面的代码保存到全局代码里,保存不了
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
此主题相关图片如下:11111111111111111111111111.png