Home > database >  Pb null object reference at the line?
Pb null object reference at the line?

Time:11-24

='wx1540c9047a15' String appid//replace
String appSecret='b1ab812b8d7760b7005d5//replace
String ls_import ls_export, ls_accesstoken ls_tokenjson, ls_response
String ls_url='https://api.weixin.qq.com/cgi-bin/token? Grant_type=client_credential '+' & amp; Appid='+ appid + & amp; Secret + appSecret='
String ls_pushurl
String ls_data

OleObject lole
Lole=CREATE oleobject
Lole. ConnectToNewObject (" Microsoft. XMLHttp ")

Lole. Open (" POST ", ls_url, false)

Lole. SetRequestHeader (" the content-type ", "application/json; Encoding=utf-8 ")
Lole. SetRequestHeader (" accept ", "* */")
Lole. SetRequestHeader (" connection ", "Keep Alive -")
Lole. SetRequestHeader (" the user-agent ", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
")Lole. SetRequestHeader (' Content - Length, the string (len (ls_data)))
Lole. Send (ls_data)

Ls_tokenjson=lole. The responseText

Ls_accesstoken=mid (ls_tokenjson, 18157)


Ls_pushurl="HTTP://https://api.weixin.qq.com/cgi-bin/message/template/send? Access_token="+ ls_accesstoken


String ls_column ls_name, ls_un ls_um, ls_lajifei, ls_amount, ls_sewage, ls_cusid, ls_fdate
Long ll_row1, ll_openid
Int I, li_return, j
String sstart skey1, skey2 skey3, skey4, skey5, smark, send, inputString;
String ls_openid
Ll_row1=dw_1. Rowcount ();

If ll_row1 & gt; 0 then
For I=1 to ll_row1
Ls_openid=' ';
Ls_cusid=dw_1. Getitemstring (I, "customer_cusid");

Ls_sewage=string (dw_1 GetItemDecimal (I, "sewage"));

Ls_lajifei=string (dw_1 GetItemDecimal (I, "lajifei"));

Ls_amount=string (dw_1 GetItemDecimal (I, "the amount"));

Ls_um=string (dw_1 GetItemDecimal (I, "um"));

Ls_un=string (dw_1 GetItemDecimal (I, "UN"));

Ls_fdate=left (sle_3. Text, 4) + 'years' + right (sle_3. Text, 2) +' month ';

Ls_name=dw_1. Getitemstring (I, "customer_name");


Dw_2. Retrieve (ls_cusid)
Ll_openid=dw_2. Rowcount ();
If ll_openid & gt; 0 then
For j=1 to ll_openid
Ls_openid=dw_2. Getitemstring (j, "openid");



Sstart='{" data ": {" first" : {" value ":" reminder notice "},';
Skey1='" keyword1 ": {" value" : "' + ls_name + '"},';

Skey2='" keyword2 ": {" value" : "' + ls_cusid + '"},';


Skey3='" keyword3 ": {" value" : "' + ls_fdate + '"},';

Skey4='" keyword4 ": {" value" : "' + ls_un + T "}, ';
Skey5='" keyword5 ": {" value" : "' + ls_amount + 'yuan "},';

Smark='" remark ": {" value" : "water' + ls_un + 'T,' + ls_um + RMB, sewage charges' + ls_sewage + 'yuan, garbage disposal fee' + ls_lajifei +, please contact with clear fee by the end of this month,"}}, ';
Send='" template_id ":" aPgAzW_NdkMP2R1w - Kzhk8KR1vIRniw5RRL6vb0ThMI ", "touser" : "' + ls_openid + '"} ";
InputString=sstart + skey1 + skey2 + skey3 + skey4 + skey5 + smark + send;
ls_data=https://bbs.csdn.net/topics/inputString






Lole. Open (" POST ", ls_pushurl, false)

Lole. SetRequestHeader (" the content-type ", "application/json; Encoding=utf-8 ")

Lole. SetRequestHeader (' Content - Length, the string (len (ls_data)))
Lole. Send (ls_data);

Ls_export=lole. The responseText;





Destroy lole



Next
End the if
Next
End the if
Messagebox (' notice ', 'send success')

CodePudding user response:

Microsoft. XMLHttp controls no registration?
  • Related