152 lines
6.4 KiB
C#
152 lines
6.4 KiB
C#
|
|
using Quartz;
|
|||
|
|
using Quartz.Impl;
|
|||
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Net;
|
|||
|
|
using System.Web;
|
|||
|
|
using System.Web.Mvc;
|
|||
|
|
using System.Web.Optimization;
|
|||
|
|
using System.Web.Routing;
|
|||
|
|
using System.Web.Security;
|
|||
|
|
using System.Web.SessionState;
|
|||
|
|
using System.Security.Cryptography;
|
|||
|
|
using System.Text;
|
|||
|
|
|
|||
|
|
namespace dccdc
|
|||
|
|
{
|
|||
|
|
public class MvcApplication : System.Web.HttpApplication
|
|||
|
|
{
|
|||
|
|
protected async void Application_Start()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
/*
|
|||
|
|
|
|||
|
|
|
|||
|
|
string ydhttp = "http://112.35.1.155:1992/sms/tmpsubmit";
|
|||
|
|
var req = new Models.duanxin.msend();
|
|||
|
|
req.ecName = "德州市德城区疾病预防控制中心";
|
|||
|
|
req.apId = "jkoa";
|
|||
|
|
req.mobiles = "18845270658";
|
|||
|
|
req.sign = "K4p4a00b9";
|
|||
|
|
req.templateId = "44b9ed56aebc4b8fb4014f7c4c0ff00d";
|
|||
|
|
req.addSerial = "";
|
|||
|
|
string[] parms = new string[4];
|
|||
|
|
parms[0] = "郑志强";
|
|||
|
|
parms[1] = "郑志强";
|
|||
|
|
parms[2] = "2019.00";
|
|||
|
|
parms[3] = "1000.00";
|
|||
|
|
req.parms = Newtonsoft.Json.JsonConvert.SerializeObject(parms);
|
|||
|
|
var md5 = MD5.Create();
|
|||
|
|
//secretKey
|
|||
|
|
var bs = md5.ComputeHash(Encoding.UTF8.GetBytes(req.ecName + req.apId + "a7551898" + req.templateId + req.mobiles + "[\"郑志强\",\"郑志强\",\"2019.00\",\"1000.00\"]" + req.sign));
|
|||
|
|
var sb = new StringBuilder();
|
|||
|
|
foreach (byte b in bs)
|
|||
|
|
{
|
|||
|
|
sb.Append(b.ToString("x2"));
|
|||
|
|
}
|
|||
|
|
req.mac = sb.ToString().ToLower();
|
|||
|
|
WebClient wc = new WebClient();
|
|||
|
|
string upstr = Newtonsoft.Json.JsonConvert.SerializeObject(req);
|
|||
|
|
upstr = upstr.Replace("parms", "params");
|
|||
|
|
//new {params }
|
|||
|
|
//upstr.Insert(upstr.Length-1,",")
|
|||
|
|
byte[] resp = wc.UploadData(ydhttp, System.Text.Encoding.UTF8.GetBytes(Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(upstr))));
|
|||
|
|
var nres = Newtonsoft.Json.JsonConvert.DeserializeObject<Models.duanxin.nrecive>(System.Text.Encoding.UTF8.GetString(resp));
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
|
|||
|
|
//cb6620fa80254683a9bd41c22b55603f
|
|||
|
|
/*
|
|||
|
|
string ydhttp = "http://112.35.1.155:1992/sms/tmpsubmit";
|
|||
|
|
var req = new Models.duanxin.msend();
|
|||
|
|
req.ecName = "德州市德城区疾病预防控制中心";
|
|||
|
|
req.apId = "jkoa";
|
|||
|
|
req.mobiles = "18653582965";
|
|||
|
|
req.sign = "d37CYmrbG";
|
|||
|
|
//
|
|||
|
|
req.templateId = "2c2e4092e23f432097dadf5672645ca6";
|
|||
|
|
req.addSerial = "";
|
|||
|
|
string[] parms = new string[1];
|
|||
|
|
parms[0] = "123213";
|
|||
|
|
req.parms = Newtonsoft.Json.JsonConvert.SerializeObject(parms);
|
|||
|
|
var md5 = MD5.Create();
|
|||
|
|
//secretKey
|
|||
|
|
var bs = md5.ComputeHash(Encoding.UTF8.GetBytes(req.ecName + req.apId + "a7551898" + req.templateId + req.mobiles + "[\"123213\"]" + req.sign));
|
|||
|
|
var sb = new StringBuilder();
|
|||
|
|
foreach (byte b in bs)
|
|||
|
|
{
|
|||
|
|
sb.Append(b.ToString("x2"));
|
|||
|
|
}
|
|||
|
|
req.mac = sb.ToString().ToLower();
|
|||
|
|
WebClient wc = new WebClient();
|
|||
|
|
string upstr = Newtonsoft.Json.JsonConvert.SerializeObject(req);
|
|||
|
|
upstr = upstr.Replace("parms", "params");
|
|||
|
|
//new {params }
|
|||
|
|
//upstr.Insert(upstr.Length-1,",")
|
|||
|
|
byte[] resp = wc.UploadData(ydhttp, System.Text.Encoding.UTF8.GetBytes(Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(upstr))));
|
|||
|
|
var nres = Newtonsoft.Json.JsonConvert.DeserializeObject<Models.duanxin.nrecive>(System.Text.Encoding.UTF8.GetString(resp));
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/*
|
|||
|
|
|
|||
|
|
string ydhttp = "http://112.35.1.155:1992/sms/tmpsubmit";
|
|||
|
|
var req = new Models.duanxin.msend();
|
|||
|
|
req.ecName = "德州市德城区疾病预防控制中心";
|
|||
|
|
req.apId = "jkoa";
|
|||
|
|
req.mobiles = "18053877568";
|
|||
|
|
req.sign = "d37CYmrbG";
|
|||
|
|
req.templateId = "cbb76eac353842aaaa8bceeb074237a4";
|
|||
|
|
req.addSerial = "";
|
|||
|
|
string[] parms = new string[1];
|
|||
|
|
parms[0] = "hIB疫苗";
|
|||
|
|
req.parms = Newtonsoft.Json.JsonConvert.SerializeObject(parms);
|
|||
|
|
var md5 = MD5.Create();
|
|||
|
|
//secretKey
|
|||
|
|
var bs = md5.ComputeHash(Encoding.UTF8.GetBytes(req.ecName + req.apId + "a7551898" + req.templateId + req.mobiles + "[\"hIB疫苗\"]" + req.sign));
|
|||
|
|
var sb = new StringBuilder();
|
|||
|
|
foreach (byte b in bs)
|
|||
|
|
{
|
|||
|
|
sb.Append(b.ToString("x2"));
|
|||
|
|
}
|
|||
|
|
req.mac = sb.ToString().ToLower();
|
|||
|
|
WebClient wc = new WebClient();
|
|||
|
|
string upstr = Newtonsoft.Json.JsonConvert.SerializeObject(req);
|
|||
|
|
upstr = upstr.Replace("parms", "params");
|
|||
|
|
//new {params }
|
|||
|
|
//upstr.Insert(upstr.Length-1,",")
|
|||
|
|
byte[] resp = wc.UploadData(ydhttp, System.Text.Encoding.UTF8.GetBytes(Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(upstr))));
|
|||
|
|
var nres = Newtonsoft.Json.JsonConvert.DeserializeObject<Models.duanxin.nrecive>(System.Text.Encoding.UTF8.GetString(resp));
|
|||
|
|
|
|||
|
|
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
Common.Global.MyApplication = Application;
|
|||
|
|
log4net.Config.XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo(Server.MapPath("~/log4net.config")));
|
|||
|
|
AreaRegistration.RegisterAllAreas();
|
|||
|
|
//int a;
|
|||
|
|
//var s = dccdc.Controllers.Charge3Controller.Query("148549239220180321095817322", out a);
|
|||
|
|
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
|||
|
|
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
|||
|
|
BundleConfig.RegisterBundles(BundleTable.Bundles);
|
|||
|
|
//开启 Unobtrusive JavaScript
|
|||
|
|
HtmlHelper.ClientValidationEnabled = true;
|
|||
|
|
string tizzy = System.Configuration.ConfigurationManager.AppSettings["zyzt"];
|
|||
|
|
if (tizzy == "1")
|
|||
|
|
{
|
|||
|
|
string debugger = System.Configuration.ConfigurationManager.AppSettings["debugger"];
|
|||
|
|
if (string.IsNullOrEmpty(debugger) || debugger != "true")
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType).Info("推送程序启动成功:" + DateTime.Now);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
protected void Application_BeginRequest(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|