05
2013
06

asp.net 使用处理程序生成带有logo的二维码

首先建一个asp.net页面,里面包含生成所需的logo上传file控件:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="QrLogCode.aspx.cs" Inherits="AdminTest_QrLogCode" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>二维码生成工具(带log)</title>
    <script type="text/javascript" src="../Jscript/admin/jquery-1.4.2.js"></script>
    <script src="../Jscript/admin/jquery.form.js" type="text/javascript"></script>
    <style type="text/css">
        .style1
        {
            width: 100%;
            min-width: 800px;
            text-align: left;
        }
        .txt
        {
            width: 40%;
        }
    </style>
</head>
<body>
    <form id="form1" enctype="multipart/form-data">
    <div>
        <table class="style1">
            <tr>
                <td style="text-align: right; width: 20%;">
                    输入要生成二维码的内容:
                </td>
                <td>
                    <input type="text" id="txt_qr" name="txt_qr" value="https://zhengdecai.com/" class="txt" />&nbsp;&nbsp;&nbsp;&nbsp;<span>请使用生成“<a
                        href="BarCode.aspx">条形码</a>”</span>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    二维码图片:
                </td>
                <td>
                    <img id="qrimg" alt="二维码图片" src="../images/20130424105224.jpg" />
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    log图片:
                </td>
                <td>
                    <input type="file" id="fileLog" name="fileLog" /> 
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    尺寸大小:
                </td>
                <td>
                    <input id="txt_size" name="txt_size" type="text" value="4" class="txt" />
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <div style="text-align: left; padding-left: 200px; margin-top: 50px;">
                        <input id="btnSubmit" type="button" value="生成二维码" /></div>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
<script type="text/javascript">
    $(function () {
        $("#btnSubmit").click(function () {
            /*if ($("[id$='fileLog']").val() == "") {
            alert("请选择log图片的文件!");
            return false;
            }*/
            var txt_qr = $("#txt_qr").val();
            var txt_size = $("#txt_size").val();
            $("[id$='form1']").ajaxSubmit({
                url: "../AjaxUrl/Admin/QrLogCode.ashx",
                type: "post",
                dataType: 'text',
                resetForm: "true",
                success: function (data) {
                    var dataObj = data;
                    if ($(dataObj).text() != "") {
                        $("#qrimg").attr("src", "../File/" + $(dataObj).text());
                    }
                    else {
                        $("#qrimg").attr("src", "../File/" + dataObj);
                    }
                    $("#txt_qr").val(txt_qr);
                    $("#txt_size").val(txt_size);
                },
                error: function (request, message, ex) {
                    alert("错误:" + message);
                }
            });
        });
    });
</script>

24
2013
05

Asp.Net使用一般处理程序读写txt文档实现页面统计

一般处理程序文件代码内容:

/// <summary>

/// $codebehindclassname$ 的摘要说明

/// </summary>

public class number : IHttpHandler

{


   public void ProcessRequest(HttpContext context)

   {

03
2013
05

简单使用Jquery和ashx一般处理程序实现无刷新上传文件

 使用html或aspx建立一个上传页面,再实用jquery进行图片或文件上传

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Porschev--Asp.Net 使用Jquery和一般处理程序实现无刷新上传大文件</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server" enctype="multipart/form-data">
    <div class="carea">
        <div class="ui-tabs-panel">
            <div class="search_head">
                <h3 class="sh_title">
                    Porschev--Asp.Net 使用Jquery和一般处理程序实现无刷新上传大文件</h3>
            </div>
            <ul class="info_input">
                <li><b>选择文件:</b>
                    <div class="ii_conarea">
                        <input id="fulFile" name="fulFile" type="file" class="ful" />
                        <img id="imgUploading" src="images/uploading.gif" alt="正在上传..." class="loading_img none" />
                    </div>
                </li>
            </ul>
            <input id="btnSubmit" type="button" value="上传" class="btn_sub" />
        </div>
    </div>
    </form>
</body>
</html>

03
2013
05

简单html控件与ashx处理程序进行上传文件操作

网上很多种上传图片的实例,再不使用aspx控件的时候可以使用html的input的file控件:<input id="imgfile" name="imgfile" type="file" />

使用aspx或html建立需要上传文件的页面:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

25
2013
04

asp.net 使用处理程序生成二维码

效果图:image

首先下载ThoughtWorks.QRCode.dll 

«1»