/// <summary> /// 发送短信通用接口 /// </summary> /// <param name="signName">管理控制台中配置的短信签名(状态必须是验证通过)</param> /// <param name="templateCode">管理控制台中配置的审核通过的短信模板的模板CODE(状态必须是验证通过)</param> /// <param name="recNum">接收号码,多个号码可以逗号分隔</param> /// <param name="paramString">短信模板中的变量;数字需要转换为字符串;个人用户每个变量长度必须小于15个字符。例:{"code":"123456","product":"登录"}</param> /// <returns>是否发送成功</returns> private static bool SingleSendSms(string signName, string templateCode, string recNum, string paramString) { IClientProfile profile = DefaultProfile.GetProfile("cn-hangzhou", "PrDPRjqAl2epRSnX", "H7vLdyxHi23Xz7hDsAevGruVAWxsFP"); IAcsClient client = new DefaultAcsClient(profile); SingleSendSmsRequest request = new SingleSendSmsRequest(); try { request.SignName = signName; // "管理控制台中配置的短信签名(状态必须是验证通过)"; request.TemplateCode = templateCode; //"管理控制台中配置的审核通过的短信模板的模板CODE(状态必须是验证通过)"; request.RecNum = recNum; //"接收号码,多个号码可以逗号分隔"; request.ParamString = paramString; //"短信模板中的变量;数字需要转换为字符串;个人用户每个变量长度必须小于15个字符。"; SingleSendSmsResponse httpResponse = client.GetAcsResponse(request); return(true); } catch (ServerException ex) { WriteLogHelper.WriteError(ex); throw; } catch (ClientException ex) { WriteLogHelper.WriteError(ex); throw; } }
/// <summary> /// 旋转 /// </summary> /// <param name="original">原图对象</param> /// <param name="newPath">要保存的路径</param> /// <param name="rotateFlipType">图像旋转量</param> /// <returns></returns> public static void KiRotate(Image original, string newPath, RotateFlipType rotateFlipType) { try { using (Bitmap bitmap = new Bitmap(original)) { bitmap.RotateFlip(rotateFlipType); bitmap.Save(newPath); } } catch (Exception ex) { WriteLogHelper.WriteError(ex); throw; } }