using NetTaste; using System; using System.Collections.Generic; using System.Net; using System.Text; using TelegramService.Help; namespace TelegramService.Bl { public class SendMessageBl { public static async Task SendWx(string url,string msg) { HttpResult httpResult; for (int i = 0; i < 2; i++) { httpResult = await HttpHelper.PostJsonAsync(url, msg); if (httpResult.StatusCode != 200) { continue; } if (httpResult.Html.IndexOfStr("\"errmsg\":\"ok\"")) { return true; } } return false; } public static async Task SendTg(string url,string msg) { HttpResult httpResult = null; for (int i = 0; i < 2; i++) { httpResult = await HttpHelper.PostJsonAsync(url, msg); if (httpResult.StatusCode != 200) { continue; } if (httpResult.Html.IndexOfStr("\"ok\":true,")) { return true; } } return false; } } }