当前位置:网站首页>[recommended by bloggers] C # generate a good-looking QR code (with source code)
[recommended by bloggers] C # generate a good-looking QR code (with source code)
2022-07-06 10:53:00 【xcLeigh】
List of articles
【 Bloggers recommend 】C# Generate a good-looking QR code ( Source code attached )
- Realization function
1. Realize two-dimensional code generation
2. Realize QR code style modification
3. Under the condition of realization , Batch build
4. Implementation style , Address and other parameters can be configured
1. Effect display
1.1 Interface effect
1.2 Interface effect after generation
1.1 QR code generated after interface configuration
2. QR code page design
<div style="background-color:white;width:100%; text-align:center;">
<div class="layui-field-box" style="background-color:orange;">
<div>
<table style="width:100%;">
<tr>
<td style="color:black;">
xcLeigh - QR code generation
</td>
<td style="text-align:right;font-size:13px;color:white;">
<a href="https://download.csdn.net/user/weixin_43151418/?spm=1003.2020.3001.5449">【 Bloggers recommend 】 Related resources </a> |
<a href="https://download.csdn.net/download/weixin_43151418/85329413?spm=1003.2166.3001.6637.6">C#MVC Background management system ( Source code attached )</a> |
<a href="https://download.csdn.net/download/weixin_43151418/85337361?spm=1003.2166.3001.6637.1">html Drop down tree ( Attached is a nice login interface )</a> |
<a href="https://download.csdn.net/download/weixin_43151418/85335759">HTML5 Responsive mobile wechat ( Source code attached )</a> |
<a href="https://download.csdn.net/download/weixin_43151418/85336631">html operation SVG chart ( Source code attached )</a>
</td>
</tr>
</table>
</div>
</div>
<hr style="margin:0px;padding:0px;margin-bottom:5px;" />
@*<div style="text-align:center; padding:15px;color:red;">
<span id="tomessage"> Conversion success , Position in D:\\</span>
</div>*@
<div class="layui-upload-drag" id="zjImg" style="margin-bottom:5px;">
<img id="ewmImg" name="ewmImg" src="~/Content/xcsharp/images/lo.png" style="width:80px;height:80px;" />
<div style="padding:2px;"></div>
<p style="color:crimson;"> QR code Logo</p>
</div>
<input id="ewmImgt" name="ewmImgt" hidden="hidden" type="text" value="Content\\xcsharp\\images\\lo.png">
<div class="layui-upload-drag" id="scImg" style="margin-bottom:5px;display:none;">
<img class="img1" src="@ViewBag.ImgScEwm" style="width:150px;height:150px;" />
<div style="padding:2px;"></div>
<p style="color:crimson;"> Generate successfully </p>
<p style="color:crimson;"> Right click to save the picture as , Save QR code </p>
</div>
<div style="text-align:left; margin:10px;">
<input id="ewmAddr" name="ewmAddr" class="layui-input" type="text" placeholder=" QR code definition : It can be an address , It can be a specific character " autocomplete="off" lay-verify="required" lay-reqtext=" QR code definition is required , How can it be empty ?">
</div>
<div style="text-align:left; margin:10px;">
<input id="ewmWz" name="ewmWz" class="layui-input" type="text" placeholder=" The bottom text can be added or not , The longest 8 Characters " maxlength="8" autocomplete="off">
</div>
<div style="text-align:left; margin:10px;">
<table>
<tr>
<td> Background color :</td>
<td>
<div style="margin-top:18px;">
<div class="layui-form-item">
<div class="layui-input-inline" style="width: 120px;">
<input type="text" value="#ffffff" placeholder=" The background color " readonly="readonly" class="layui-input" id="ewmBgColor" name="ewmBgColor">
</div>
<div class="layui-inline" style="left: -11px;">
<div id="ewmBgColor_d"></div>
</div>
</div>
</div>
</td>
<td> QR code color :</td>
<td>
<div style="margin-top:18px;">
<div class="layui-form-item">
<div class="layui-input-inline" style="width: 120px;">
<input type="text" value="#1EABFC" placeholder=" The background color " readonly="readonly" class="layui-input" id="ewmColor" name="ewmColor">
</div>
<div class="layui-inline" style="left: -11px;">
<div id="ewmColor_d"></div>
</div>
</div>
</div>
</td>
<td> Text color :</td>
<td>
<div style="margin-top:18px;">
<div class="layui-form-item">
<div class="layui-input-inline" style="width: 120px;">
<input type="text" value="#1EABFC" placeholder=" The background color " readonly="readonly" class="layui-input" id="ewmFontColor" name="ewmFontColor">
</div>
<div class="layui-inline" style="left: -11px;">
<div id="ewmFontColor_d"></div>
</div>
</div>
</div>
</td>
<td> Text font :</td>
<td>
<select name="ewmWzFont" lay-filter="aihao">
<option value=" In black " selected=""> In black </option>
<option value=" Song style "> Song style </option>
<option value=" Imitation song "> Imitation song </option>
</select>
</td>
<td style="padding-left:20px;"> Four corner color :</td>
<td>
<div style="margin-top:18px;">
<div class="layui-form-item">
<div class="layui-input-inline" style="width: 120px;">
<input type="text" value="#1EABFC" placeholder=" The background color " readonly="readonly" class="layui-input" id="ewmSgjColor" name="ewmSgjColor">
</div>
<div class="layui-inline" style="left: -11px;">
<div id="ewmSgjColor_d"></div>
</div>
</div>
</div>
</td>
</tr>
</table>
</div>
<div style="text-align:left; margin:10px;">
<table>
<tr>
<td> Whether to display four corners :</td>
<td>
<input name="ewmSgj" type="checkbox" checked="" lay-skin="switch" lay-filter="switchTest" lay-text=" Show | hide ">
</td>
<td></td>
</tr>
</table>
</div>
<div style="text-align:left; margin:10px;">
<button class="layui-btn" data-type="parseTable" type="submit" lay-filter="demo1" lay-submit=""> Generate qr code </button>
</div>
@*<div class="layui-upload-drag" id="wordtopdf" style="margin-bottom:5px;">
<i class="layui-icon"></i>
<p style="color:crimson;">WORD turn PDF(doc Format )</p>
<p> Click upload , Or drag the file here </p>
</div>*@
</div>
3. Background operation of QR code generation
public ActionResult EwmImg() {
try
{
var file = Request.Files[0]; // Get the selected file
var filecombin = file.FileName.Split('.');
// File name
string filename = Path.GetFileName(file.FileName);
if (file == null || filename.IndexOf("&") != -1 || String.IsNullOrEmpty(file.FileName) || file.ContentLength == 0 || filecombin.Length < 2)
{
return Json(new
{
fileid = 0,
src = "",
name = "",
msg = " Upload error Please check the file name or Whether the image format conforms to "
});
}
// Define the local path location
string local = "upload\\ewm\\img\\";
string localPath = Path.Combine(HttpRuntime.AppDomainAppPath, local);
if (!System.IO.Directory.Exists(localPath))
System.IO.Directory.CreateDirectory(localPath);
string newPath = localPath + filename;
file.SaveAs(newPath);
// Save the picture
return Json(new
{
src = newPath.Trim().Replace("\\", "|"),
name = filename,
// Get file name without suffix
msg = " Upload successful "
});
}
catch { }
return Json(new
{
src = "",
name = "", // Get file name without suffix
msg = " Upload error "
});
}
4. Source download
【 Bloggers recommend 】C# Generate a good-looking QR code ( Source code )
边栏推荐
- Pytoch LSTM implementation process (visual version)
- CSDN-NLP:基于技能树和弱监督学习的博文难度等级分类 (一)
- CSDN问答标签技能树(五) —— 云原生技能树
- A trip to Macao - > see the world from a non line city to Macao
- La table d'exportation Navicat génère un fichier PDM
- Installation and use of MySQL under MySQL 19 Linux
- MySQL23-存儲引擎
- Record the first JDBC
- Mysql33 multi version concurrency control
- Global and Chinese markets for aprotic solvents 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢
[unity] simulate jelly effect (with collision) -- tutorial on using jellysprites plug-in
Mysql33 multi version concurrency control
MySQL21-用户与权限管理
CSDN问答模块标题推荐任务(一) —— 基本框架的搭建
数据库中间件_Mycat总结
MySQL34-其他数据库日志
Mysql32 lock
MySQL29-数据库其它调优策略
Win10: how to modify the priority of dual network cards?
Breadth first search rotten orange
随机推荐
API learning of OpenGL (2002) smooth flat of glsl
frp内网穿透那些事
Time in TCP state_ The role of wait?
Record the first JDBC
【博主推荐】C# Winform定时发送邮箱(附源码)
[paper reading notes] - cryptographic analysis of short RSA secret exponents
Discriminant model: a discriminant model creation framework log linear model
Emotional classification of 1.6 million comments on LSTM based on pytoch
First blog
[unity] simulate jelly effect (with collision) -- tutorial on using jellysprites plug-in
Unicode decodeerror: 'UTF-8' codec can't decode byte 0xd0 in position 0 successfully resolved
Database middleware_ MYCAT summary
Global and Chinese markets for aprotic solvents 2022-2028: Research Report on technology, participants, trends, market size and share
CSDN问答标签技能树(五) —— 云原生技能树
@Controller, @service, @repository, @component differences
Moteur de stockage mysql23
1. Mx6u learning notes (VII): bare metal development (4) -- master frequency and clock configuration
MySQL27-索引优化与查询优化
Navicat 導出錶生成PDM文件
Isn't there anyone who doesn't know how to write mine sweeping games in C language