📄 mxcon.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
namespace jd
{
/// <summary>
/// mxcon 的摘要说明。
/// </summary>
public class mxcon : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.Image Image23;
protected System.Web.UI.WebControls.Panel Panel4;
protected System.Web.UI.HtmlControls.HtmlGenericControl MARQUEE1;
protected System.Web.UI.WebControls.Label Label4;
protected System.Web.UI.WebControls.Label Label5;
protected System.Web.UI.WebControls.Label Label6;
protected System.Web.UI.WebControls.Label Label7;
protected System.Web.UI.WebControls.Label Label8;
protected System.Web.UI.WebControls.Label Label9;
protected System.Web.UI.WebControls.Label Label10;
protected System.Web.UI.WebControls.Label Label11;
protected System.Web.UI.WebControls.HyperLink HyperLink9;
protected System.Web.UI.WebControls.HyperLink HyperLink10;
protected System.Web.UI.WebControls.Label Label21;
protected System.Web.UI.WebControls.Label Label22;
protected System.Web.UI.WebControls.Label L1;
protected System.Web.UI.WebControls.Label L2;
protected System.Web.UI.WebControls.Label L3;
protected System.Web.UI.WebControls.Label L5;
protected System.Web.UI.WebControls.Label L4;
protected System.Web.UI.WebControls.Label L6;
protected System.Web.UI.WebControls.Label L7;
protected System.Web.UI.WebControls.Label L8;
protected System.Web.UI.WebControls.Label L9;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Image Image3;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(Request["公司"]==null)
{
Response.Redirect("mainex.aspx");//如果为空显示经销页
}
else
{
string connstr=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath(@".\databast.mdb");
OleDbConnection conn=new OleDbConnection(connstr);
conn.Open();
string sql="select * from 经销详细表 where 公司='"+Request["公司"]+"'";
OleDbCommand comm=new OleDbCommand(sql,conn);
OleDbDataReader mydata=comm.ExecuteReader();
string str;
try
{
while(mydata.Read())
{
for(int i=0;i<mydata.FieldCount;i++)
{
if(mydata.GetName(i)=="公司")
{
this.L1.Text=mydata.GetValue(i).ToString();
}
if(mydata.GetName(i)=="企业法人")
{
this.L2.Text=mydata.GetValue(i).ToString();
}
if(mydata.GetName(i)=="企业性质")
{
this.L3.Text=mydata.GetValue(i).ToString();
}
if(mydata.GetName(i)=="公司地址")
{
this.L4.Text=mydata.GetValue(i).ToString();
}
if(mydata.GetName(i)=="联系电话")
{
this.L5.Text=mydata.GetValue(i).ToString();
}
if(mydata.GetName(i)=="邮编")
{
this.L6.Text=mydata.GetValue(i).ToString();
}
if(mydata.GetName(i)=="企业邮箱")
{
this.L7.Text=mydata.GetValue(i).ToString();
}
if(mydata.GetName(i)=="公司网址")
{
this.L8.Text=mydata.GetValue(i).ToString();
}
if(mydata.GetName(i)=="公司介绍")
{
str=mydata.GetValue(i).ToString();
this.L9.Text=str;
}
}
}
}
finally
{
mydata.Close();
conn.Close();
}
}
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Write("<script>close()</script>");//关闭mxcon.aspx
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -