易截截图软件、单文件、免安装、纯绿色、仅160KB

ASP.NET 登录界面

//default.aspx.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Runtime.InteropServices;
using System.Configuration;
using System.Web.UI.WebControls;
using System.Web.Services.Description;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Button4.Attributes.Add("onclick", "window.open('Register.aspx')");//通过button4打开链接
string strConnection = ConfigurationManager.AppSettings["Str.Properties.Settings.masterConnectionString"].ToString();
SqlConnection objConnection = new SqlConnection(strConnection);
objConnection.Open();
SqlCommand cmd = new SqlCommand("select * from judging where name='" + TextBox1.Text.Trim() + "'", objConnection);
string sql = "select * from judging where name='" + TextBox1.Text + "'and password='" + TextBox2.Text + "'";
cmd.CommandText = sql;
/*
***********************************************************************************************
*判断是否有此ID,ExecuteScalar() return the first column of the first row in the result set.
*/
if (cmd.ExecuteScalar() == null)//无此用户
{
Label1.Text = "Sorry, please check your id and psw";
Button3.Visible = false;
}
else
{
Label1.Text ="Welcome to "+TextBox1.Text;
Button3.Visible = true;
}

}
protected void Button1_Click(object sender, EventArgs e)
{
Panel1.Visible = false;
Panel2.Visible = true;
}
protected void Button4_Click(object sender, EventArgs e)
{

}
protected void Button3_Click(object sender, EventArgs e)


相关文档:

ASP.NET 2.0缓存

一、页输出缓存
1.设置 ASP.NET
页缓存的两种方式
1.1
以声明方式设置 ASP.NET 页的缓存
以声明方式设置 ASP.NET
页的缓存的方法是在页中使用 @ OutputCache 指令,它的常用属性如下:
程序代码
<%@ OutputCache Duration="" VaryByParam=""
VaryByControl="" VaryByHeader ......

ASP.net Gridview 使用指南

GridView使用详解
 01 GridView无代码分页排序
 02 GridView选中,编辑,取消,删除
 03 GridView正反双向排序
 04 GridView和下拉菜单DropDownList结合
05 GridView和CheckBox结合
 06 鼠标移到GridView某一行时改变该行的背景色方法一
 07 鼠标移到GridView某一行时改变该行的背景 ......

asp.net利用jquery的ajax方法来验证登陆的代码

许多程序员在做业务开发时往往会在服务器端做用户信息的验证,有没有考虑过用jquery的ajax方法来验证登陆呢?且效果比在服务器端写代码来验证好的多,页面无刷新即可实现实现登陆验证,代码也简单。
现在下面贴出来的是很简单的用jquery的ajax方法来验证登陆的代码,适合刚接触jquery的朋友学习。
前台页面代码:
<he ......

在asp.Net中使用fileuplod控件实现上传图片的功能

很多地方都应用到图片上传功能,那么究竟怎样可以实现呢?下面我来给大家进行讲解
在visual studio中自带的一个控件fileupload,可以实现此功能,我要给大家介绍的是它的用法。
 
首先要新建一个网页(下面是我创建好的一个网页)
在网页中拖进fileupload控件,后面放一个上传按钮
这样,当我们点击上传按钮时,图 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号