WeiWeiXinNet/admin/QrCodeHandler.ashx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*
 *    WeWeiXin.NET 
 *
 *    论坛:http://tieba.baidu.com/f?kw=微微信_net
 *    更新:udoo123.taobao.com
 *    作者:http://blog.csdn.net/weixin_net
 *    QQ群:172036441
 *    授权:个人或公司运营自身微信公众号使用和二次开发自由使用,或者针对特定的单个用户进行二次开发自由使用,禁止重新包装后批量转卖
 */
using System;
using System.Drawing.Imaging;
using System.IO;
using System.Net;
using System.Web;
using Gma.QrCodeNet.Encoding;
using Gma.QrCodeNet.Encoding.Windows.Render;

namespace WeiWeiXinNet.admin
{
	/// <summary>
	/// 
    /// 
    /// QR二维码生成
    /// 
    /// 
    /// 
	/// </summary>
	public class QrCodeHandler : IHttpHandler
	{
		public void ProcessRequest(HttpContext context)
		{
			// Retrieve the parameters from the QueryString
			var codeParams = CodeDescriptor.Init(context.Request);

			// Encode the content
			if (codeParams == null || !codeParams.TryEncode())
			{
				context.Response.StatusCode = (int) HttpStatusCode.BadRequest;
				return;
			}

			// Render the QR code as an image
			using (var ms = new MemoryStream())
			{
				codeParams.Render(ms);
				context.Response.ContentType = codeParams.ContentType;
				context.Response.OutputStream.Write(ms.GetBuffer(), 0, (int) ms.Length);
			}
		}

		/// <summary>
		/// Return true to indicate that the handler is thread safe because it is stateless
		/// </summary>
		public bool IsReusable
		{
			get { return true; }
		}
	}

	/// <summary>
后面还有 65 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。