找传奇、传世资源到传世资源站!

C# 微信扫码支付 例子源码下载

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

C# 微信扫码支付 例子源码下载 C#语言基础-第1张
using System;using System.Collections.Generic;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Drawing;using System.Drawing.Imaging;using System.IO;using System.Text;using ThoughtWorks;using ThoughtWorks.QRCode;using ThoughtWorks.QRCode.Codec;using ThoughtWorks.QRCode.Codec.Data;namespace WxPayAPI{ public partial class MakeQRCode : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.QueryString["data"])) { string str = Request.QueryString["data"]; //初始化二维码生成工具 QRCodeEncoder qrCodeEncoder = new QRCodeEncoder(); qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE; qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M; qrCodeEncoder.QRCodeVersion = 0; qrCodeEncoder.QRCodeScale = 4; //将字符串生成二维码图片 Bitmap image = qrCodeEncoder.Encode(str, Encoding.Default); //保存为PNG到内存流 MemoryStream ms = new MemoryStream(); image.Save(ms, ImageFormat.Png); //输出二维码图片 Response.BinaryWrite(ms.GetBuffer()); Response.End(); } } }}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复