// /open/Qr?content=baidu.com public IActionResult Qr(string content) { if (!content.HasValue()) { content = "baidu.com"; } return(File(QRCoderUtility.CreateQrCode(content).BitmapToBytes(), "image/jpeg")); }
// /Demo/TestQR?content=baidu.com public ActionResult TestQR(string content) { if (!content.HasValue()) { content = "baidu.com"; } var path = "/UserFiles/QrCode.jpg"; QRCoderUtility.CreateQrCode(content, PathUtility.ToPhysicalPath(path)); return(File(path, "image/jpeg")); }