private void SendMsg() { string content = rtxtInputBox.Text.Trim(); if (content == "") { MessageBoxAdapter.ShowInfo("发送内容不能为空,请重新输入"); rtxtInputBox.Text = ""; return; } string openId = this.Name; string url = TheMotherWin.WeiXinOfServiceOnlineInovkeAddress + "/api/share/v1/SendWXMessage"; string payLoad = new WXRequestTextMessage { touser = openId, msgtype = WXRequestMessageType.text.ToString(), text = new WXTextMessageWrapper { content = content } }.ToJson(); HttpAdapter.postAsyncStr(url, payLoad, (ret1, res1) => { webBrowser.Document.InvokeScript("sendMsg", new object[] { content }); rtxtInputBox.Text = ""; }, (he) => { MessageBoxAdapter.ShowInfo("发送失败:" + he.Message); }); }