using Models;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using ThoughtWorks.QRCode.Codec;
namespace BaluPlatform.Controllers
{
public class TestController : Controller
{
// GET: Test
public ActionResult Index()
{
string img = tsetIndex("https://www.baidu.com/index.php?tn=monline_3_dg");
ViewBag.img = img;
return View();
}
/// <summary>
/// 生成二维码
/// </summary>

本文展示了如何使用C#生成二维码图片。通过`QRCodeEncoderUtil`方法编码指定内容,并将其保存为位图文件,最后返回二维码图片的URL路径。代码中详细解释了每个步骤,包括错误处理。
最低0.47元/天 解锁文章
4404

被折叠的 条评论
为什么被折叠?



