public static string GetCommonLeverQrCode(string url) { var qrCodeFilePath = QrCodeHelper.CreateImage(url, 24); return(qrCodeFilePath); }
private static void Main(string[] args) { Console.WriteLine("请输入要生成物料的数量!!!"); var readCount = Console.ReadLine(); var result = CommonHelper.IsNumeric(readCount); if (!result) { Console.WriteLine("请输入正确数量"); } else { var createNum = Convert.ToInt32(readCount); const string qrEncodingType = "BYTE"; const string createLevel = "H"; const int version = 8; const int scale = 12; var showurlArr = GetShortUrl(); for (int i = 0; i < createNum; i++) { var jumpAddress = showurlArr[i]; //1.生成二维码图片 //var qrCodeFilePath = CreateCode_Choose(jumpAddress, qrEncodingType, createLevel, version, scale); var qrCodeFilePath = QrCodeHelper.CreateImage(jumpAddress, 24); //2.拼接二维码图片,生成物料图片 var waterMark = WaterMarkImage(qrCodeFilePath); DIVWaterMark(waterMark, i); Console.WriteLine("第{0}合成图片成功!", i + 1); } } //var imgUrl = GetUpYunImgUrl(); //var testTemp = imgUrl; //var orderSuccessEntity = new OrderSuccessEntity //{ // AccountId = 397, // ProductName = "高级版一年", // OrderId = "2343435", // RealPayMoney = 23434, // OrderTypeId = 4, // Phone = "15377541070" //}; //var sendHelper = new MessagePublisherHelper(); //var result = sendHelper.SendMessage(orderSuccessEntity); //Console.WriteLine(result); //var calculateResult = 1 | 2; //Console.WriteLine(calculateResult); //var onFeeCount = 0; //var fiveFeeMaterialCount = 0; //var eightMaterialCoupon = 0; //var alllifeCount = 0; //var redPacketCount = 0; //var t1Count = 0; //var hunderFlowCount = 0; //var luckJoinCount = 0; //var requestUrl = "http://192.168.20.227:8092/v0/rewards/luckdraw"; //var requestHeader = new Dictionary<string, string> //{ // { // "token", // "D196EE7AC3C620B6EABA08B9282FDFE5EDD0147FF2EBDDFA5E50EE2F39F5F2D60D96DD812ED240A7FE7E1140D7985340" // } //}; //var testCount = 5000; //for (int i = 0; i <= testCount; i++) //{ // var doResult = CommonHelper.RestPost(requestUrl, null, null, requestHeader); // if (!string.IsNullOrWhiteSpace(doResult)) // { // var luckDrawObj = JsonConvert.DeserializeObject<ResponseModel>(doResult); // if (luckDrawObj.Code == 0) // { // var luckItemId = JsonConvert.DeserializeObject<LuckDrawResult>(luckDrawObj.Data.ToString()) // .LuckDrawItemID; // if (luckItemId == 1) // { // onFeeCount = onFeeCount + 1; // } // else if (luckItemId == 2) // { // fiveFeeMaterialCount = fiveFeeMaterialCount + 1; // } // else if (luckItemId == 3) // { // eightMaterialCoupon = eightMaterialCoupon + 1; // } // else if (luckItemId == 4) // { // alllifeCount = alllifeCount + 1; // } // else if (luckItemId == 5) // { // redPacketCount = redPacketCount + 1; // } // else if (luckItemId == 6) // { // t1Count = t1Count + 1; // } // else if (luckItemId == 7) // { // hunderFlowCount = hunderFlowCount + 1; // } // else if (luckItemId == 8) // { // luckJoinCount = luckJoinCount + 1; // } // var luckItemName = JsonConvert.DeserializeObject<LuckDrawResult>(luckDrawObj.Data.ToString()) // .LuckDrawItemName; // Console.WriteLine("恭喜您,中奖为:{0}", luckItemName); // } // } //} //Console.WriteLine("1元话费满减券中奖次数:{0}",onFeeCount); //Console.WriteLine("5元硬件满减券中奖次数:{0}", fiveFeeMaterialCount); //Console.WriteLine("V1商米88元满减券中奖次数:{0}", eightMaterialCoupon); //Console.WriteLine("终身高级版中奖次数:{0}", alllifeCount); //Console.WriteLine("1111元现金红包中奖次数:{0}", redPacketCount); //Console.WriteLine("商米T1一体机中奖次数:{0}", t1Count); //Console.WriteLine("100M全国流量中奖次数:{0}", hunderFlowCount); //Console.WriteLine("感谢参与中奖次数:{0}", luckJoinCount); Console.ReadLine(); }