首页 > 其他 > 详细

生成二维码

时间:2014-03-11 15:50:38      阅读:544      评论:0      收藏:0      [点我收藏+]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class qr
{
    public qr()
    {
        //
        //TODO: 在此处添加构造函数逻辑
        //
    }
    /*
     bg  背景颜色    bg=颜色代码,例如:bg=ffffff
     fg  前景颜色    fg=颜色代码,例如:fg=cc0000
     gc  渐变颜色    gc=颜色代码,例如:gc=cc00000
     el  纠错等级    el可用值:h\q\m\l,例如:el=h
     w   尺寸大小    w=数值(像素),例如:w=300
     m   静区(外边距) m=数值(像素),例如:m=30
     pt  定位点颜色(外框)   pt=颜色代码,例如:pt=00ff00
     inpt    定位点颜色(内点)   inpt=颜色代码,例如:inpt=000000
     logo    logo图片  logo=图片地址,例如:logo=http://www.xxx.cn/logo.png
     */
    public const string api = "http://qr.liantu.com/api.php";
 
    public static string GenerationCard(string name, string tel, string email, string logo = "")
    {
        string RequestUrl = api;
        string macard = "MECARD:N:" + name + ";TEL:" + tel + ";EMATL;" + email + ";";
        RequestUrl += "?text=" + macard;
        if (logo != "")
        {
            RequestUrl += "&logo=" + logo;
        }
        return RequestUrl;
    }
}

 生成二维码后台

 前台页面

 

调用页面

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<head>
    <title>生成验证码(演示)</title>
</head>
<body>
    <form action="creatCode.aspx" id="form1">
    <label for="txtName">
        姓名:</label>
    <input type="text" name="txtName" /><br />
    <label for="tel">
        电话:
    </label>
    <input type="text" name="tel" /><br />
    <label for="email">
        邮箱:
    </label>
    <input type="text" name="email" /><br />
    <input type="submit" name="submit" value="生成验证码" />
    </form>
    <script type="text/javascript">
        form1.submit.onclick = function () {
            var name = form1.name.value;
            var tel = form1.tel.value;
            var email = form1.email.value;
            window.location.href = "/creatCode.aspx?name=" + name + "&tel=" + tel + "&email=" + email;
        }
    </script>
</body>
</html>

生成二维码,布布扣,bubuko.com

生成二维码

原文:http://www.cnblogs.com/qiailu/p/3592906.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!