18
2015
06

Android开发学习:自定义弹出层对话框(样式通过xml设置)

Android开发学习

Android开发中,会需要对自己定义自己的弹出提示层,不使用系统默认的。

14
2015
06

【C#、Asp.Net 工具类大全】GridView 绑定数据及操作大全工具类

前端页面代码:

<style type="text/css">
    #DataList1 { border:solid 1px #ff0000; width:600px;}
    #GridView1 { border:solid 1px #00ff00; margin-top:10px; width:600px;}
    .Repeater { border:solid 1px #0000ff; margin-top:5px; width:600px;}
</style>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" GridLines="None"
    UseAccessibleHeader="False" OnRowDataBound="GridView1_RowDataBound">
    <Columns>
        <asp:TemplateField HeaderText="站点">
            <ItemTemplate>
                <asp:Label ID="UserSite" runat="server" Text='<%#Bind("UserSite") %>'></asp:Label>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center"/>
        </asp:TemplateField>
        <asp:BoundField DataField="UserName" HeaderText="姓名" />
        <asp:BoundField DataField="UserAge" HeaderText="年龄" />
        <asp:BoundField DataField="UserSex" HeaderText="性别" />
    </Columns>
</asp:GridView>

使用C#实例:

13
2015
06

【C#、Asp.Net 工具类大全】绑定服务器数据控件大全工具类

前端页面代码:

<style type="text/css">
    #DataList1 { border:solid 1px #ff0000; width:600px;}
    #GridView1 { border:solid 1px #00ff00; margin-top:10px; width:600px;}
    .Repeater { border:solid 1px #0000ff; margin-top:5px; width:600px;}
</style>
<asp:DataList ID="DataList1" runat="server">
    <ItemTemplate>
        <table border="0">
            <tr>
                <td>
                    <%#Eval("UserSite")%>&nbsp;&nbsp;&nbsp;&nbsp;<%#Eval("UserName")%>
                </td>
                <td>
                    <%#Eval("UserAge")%>&nbsp;&nbsp;&nbsp;&nbsp;<%#Eval("UserSex")%>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</asp:DataList>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" GridLines="None"
    UseAccessibleHeader="False" OnRowDataBound="GridView1_RowDataBound">
    <Columns>
        <asp:TemplateField HeaderText="站点">
            <ItemTemplate>
                <asp:Label ID="UserSite" runat="server" Text='<%#Bind("UserSite") %>'></asp:Label>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center"/>
        </asp:TemplateField>
        <asp:BoundField DataField="UserName" HeaderText="姓名" />
        <asp:BoundField DataField="UserAge" HeaderText="年龄" />
        <asp:BoundField DataField="UserSex" HeaderText="性别" />
    </Columns>
</asp:GridView>
<asp:Repeater ID="Repeater1" runat="server">
    <ItemTemplate>
        <table border="0" class="Repeater">
            <tr>
                <td>
                    <%#Eval("UserSite")%>&nbsp;&nbsp;&nbsp;&nbsp;<%#Eval("UserName")%>
                </td>
                <td>
                    <%#Eval("UserAge")%>&nbsp;&nbsp;&nbsp;&nbsp;<%#Eval("UserSex")%>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</asp:Repeater>

使用C#实例:

09
2015
06

【C#、Asp.Net 工具类大全】VerCode验证码生成工具类

使用实例:

protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    { 
        verCodeInfo();
    }
}
/// <summary>
/// 验证码生成
/// </summary>
private void verCodeInfo()
{
    /*方法1*/
    VerCodeHelper v = new VerCodeHelper();
    Response.Write("<IMG alt=\"" + "" + "\" src=\"data:image/png;base64," + FileHelper.ImgToBase64String(v.Image) + "\" border=\"0\">"); //固定生成长度的验证码
    /*方法1*/
    
    /*方法2*/
    string chkCode = VerCodeHelper.MakeCode(5); //根据长度自动生成
    MemoryStream ms = VerCodeHelper.CreateCodeImg(chkCode);
    Response.ClearContent();
    Response.ContentType = "image/gif";
    Response.BinaryWrite(ms.ToArray());
    /*方法2*/
}

类库信息:

07
2015
06

【C#、Asp.Net 工具类大全】QrCode二维码生成工具类

使用实例:

private string urlPath = "";
protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        urlPath = Server.MapPath("~/file/");
        qrCodeInfo();
    }
}
/// <summary>
/// 二维码生成
/// </summary>
private void qrCodeInfo()
{
    Response.Write("<IMG alt=\"" + "" + "\" src=\"" + "file/" + QrCodeHelper.getQrCodePath("https://www.zhengdecai.com/", "8", urlPath, "zhengdecai_qr.png") + "\" border=\"0\">" + "&nbsp;");
    Response.Write("<IMG alt=\"" + &qu