Backup/Web/Appendix/YouZhengCode.aspx.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;

public partial class Appendix_YouZhengCode : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            //绑定省份和地区
            OleDbConnection Conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + HttpContext.Current.Server.MapPath("中国邮编区号.mdb"));
            Conn.Open();

            OleDbCommand MyCommand = new OleDbCommand("select distinct 省洲名称 from 中国邮编区号", Conn);
            OleDbDataReader MyReader = MyCommand.ExecuteReader();
            while (MyReader.Read())
            {
                this.DropDownList1.Items.Add(MyReader["省洲名称"].ToString());
            }
            MyReader.Close();

            OleDbCommand MyCommand1 = new OleDbCommand("select distinct 地区 from 中国邮编区号 where 省洲名称='" + this.DropDownList1.SelectedItem.Text + "' order by 地区", Conn);
            OleDbDataReader MyReader1 = MyCommand1.ExecuteReader();
            while (MyReader1.Read())
            {
                this.DropDownList2.Items.Add(MyReader1["地区"].ToString());
            }
            MyReader1.Close();

            Conn.Close();
        }
    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        this.DropDownList2.Items.Clear();
        //绑定省份和地区
        OleDbConnection Conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + HttpContext.Current.Server.MapPath("中国邮编区号.mdb"));
        Conn.Open();

        OleDbCommand MyCommand1 = new OleDbCommand("select distinct 地区 from 中国邮编区号 where 省洲名称='" + this.DropDownList1.SelectedItem.Text + "' order by 地区", Conn);
        OleDbDataReader MyReader1 = MyCommand1.ExecuteReader();
        while (MyReader1.Read())
        {
            this.DropDownList2.Items.Add(MyReader1["地区"].ToString());
        }
        MyReader1.Close();

        Conn.Close();
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
后面还有 43 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。