摘要: create database Usersgouse Usersgocreate table Users(userId int primary key identity(1001,1),username varchar(50),password varchar(50))goinsert into Users values('admin','123456')goselect * from Users... 阅读全文
posted @ 2009-12-26 22:33 ^特殊П佀命^ 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 如用户登陆成功后,跳到这个页面using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;public partial class _Default : System.Web.UI.Page {... 阅读全文
posted @ 2009-12-26 22:31 ^特殊П佀命^ 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 设计如图:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/... 阅读全文
posted @ 2009-12-26 22:29 ^特殊П佀命^ 阅读(208) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Data;using System.Configuration;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebContr... 阅读全文
posted @ 2009-12-26 22:22 ^特殊П佀命^ 阅读(507) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Data;using System.Configuration;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebContr... 阅读全文
posted @ 2009-12-26 22:17 ^特殊П佀命^ 阅读(142) 评论(0) 推荐(0) 编辑
摘要: <以用户登陆为例>using System;using System.Data;using System.Configuration;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.... 阅读全文
posted @ 2009-12-26 22:06 ^特殊П佀命^ 阅读(198) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Data;using System.Data.SqlClient;using System.Configuration;/// <summary>///DBHelper 的摘要说明/// </s... 阅读全文
posted @ 2009-12-26 21:54 ^特殊П佀命^ 阅读(950) 评论(0) 推荐(0) 编辑
摘要: 在VS2008配置文件中,找到Ctrl+F找到<connectionStrings/>把它去掉,然后再找到<appSettings/>把这段代码写在<appSettings/>后面 <connectionStrings> <add name="connectionString" connectionString="server=.;databa... 阅读全文
posted @ 2009-12-26 21:43 ^特殊П佀命^ 阅读(2485) 评论(0) 推荐(0) 编辑
摘要: 拖一个FileUpload控件,设计如图:查看源:<body> <form id="form1" runat="server"> <div> <asp:FileUpload ID="UploadFile" runat="server" /> <br /> <asp:Button ID="btnSave" runat="server"... 阅读全文
posted @ 2009-12-26 19:46 ^特殊П佀命^ 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 拖一个DropDownList到内置aspx中,设置属性AutoPostBack为true,在设计中双击控件<body> <form id="form1" runat="server"> <div> <asp:DropDownList ID="ddlGetId" runat="server" AutoPostBack="true" onselectedin... 阅读全文
posted @ 2009-12-26 14:26 ^特殊П佀命^ 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 拖一个DropDownList到内置aspx中,设置属性AutoPostBack为true,在设计中双击控件<body> <form id="form1" runat="server"> <div> <asp:DropDownList ID="ddlGetId" runat="server" AutoPostBack="true" onselectedin... 阅读全文
posted @ 2009-12-26 14:20 ^特殊П佀命^ 阅读(340) 评论(0) 推荐(0) 编辑
摘要: 拖两个DropDownList控件到aspx设计选中第一个控件,在DropDownList任务里面选择编辑项添加三个值,如图:在第二个DropDownList添加一项:请选择查看源:<body> <form id="form1" runat="server"> <div> <asp:DropDownList ID="ddlGD" runat="server... 阅读全文
posted @ 2009-12-26 13:59 ^特殊П佀命^ 阅读(704) 评论(0) 推荐(0) 编辑
摘要: Literal控件与Lable控件的区别在于Literal控件不向文本中添加任何HTML元素,Lable控件呈现一个span元素,Literal控件不支持包括属性在内的任何样式属性,但是Literarl控件允许指定是否对内容编码。可以在Text属性里面写文本标签 <b>标签内容</b>...Mode属性:确定是转换文本还是将文本编码Transfrom:添加到控件中的任何标记... 阅读全文
posted @ 2009-12-26 13:34 ^特殊П佀命^ 阅读(289) 评论(0) 推荐(0) 编辑
摘要: TextBox 控件用于创建用户可输入文本的文本框。AutoPostBack属性:在文本修改后,自动回发到服务器,默认为false,如果要回传,改为True。TextMode属性:文本框的行为模式,单行、多行、密码AccessKey属性:使用键盘快捷键TextChange事件:在更改文本属性后激发<%--设置快捷键(Alt+N)把光标移动到指定文本框--%> <asp:TextB... 阅读全文
posted @ 2009-12-26 13:17 ^特殊П佀命^ 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 可以使用Label控件来标注一个HTML表单字段。Label控件拥有属性AssociatedControlID,可以设置此属性来指向表示表单字段的ASP.NET控件。如:<asp:Label ID="labTest" runat="server" AssociatedControlID="txtName">User<u>N</u>ame</asp:Labe... 阅读全文
posted @ 2009-12-26 13:02 ^特殊П佀命^ 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 一个接口定义了一个契约。接口可以包容方法、C#属性、事件、以及索引器。在一个接口声明中,我们可以声明零个或者多个成员。所有接口成员的默认访问类型都是public。不允许声明成员上的修饰符,即使是pubilc都不行,因为接口成员总是公有的,也不能声明为虚拟和静态的。如果需要修饰符,最好让实现类来声明与一个非抽象类类似,一个抽象类必须提供接口中所有成员的实现,只要这些成员在这个类的基类中出现过。接口可... 阅读全文
posted @ 2009-12-26 11:49 ^特殊П佀命^ 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 在定义类的前面加上关键字abstract,那么这个类就是抽象类了,抽象类本身无法产生实例对象,而且抽象类包含了一个以上的抽象方法,这些方法只是提供函数名称,并没有定义如何具体实现,由继承的派生类实现,派生类同时必须实现所有抽象类的方法,否则其本身将成为另外一个抽象类。需要我们注意的一点是,当派生类重写抽象类的方法时,要使用override关键字来重写抽象类所定义的方法抽象类只能被继承,不能被实例化... 阅读全文
posted @ 2009-12-26 11:24 ^特殊П佀命^ 阅读(2650) 评论(0) 推荐(0) 编辑
摘要: 面向对象3大机制 封装,隐藏内部实现 继承,复用现有代码 多态,改写对象行为对象是什么?从概念层面讲,对象是某种拥有责任的抽象。从规格层面讲,对象是一系统可以被其他对象使用的公共接口。从语言实现层面,对象封装了代码和数据。怎么才能设计好的面向对象?遵循一定的面向对象设计原则。熟悉一些典型的面向对象设计模式。从设计原则到设计模式1针对接口编程而不是针对实现编程2优先使用对象组合,而不是类继承类继承通... 阅读全文
posted @ 2009-12-26 10:58 ^特殊П佀命^ 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 父类引用指向子类对象(基类声明变量,子类实例化)注意三种情况一)、基类是否有virtual,先扫描自己(基类),如果没有,调用自己(基类)的方法,当然所有继承它类的子类就不能有override方法: public class Person { public void show() { Console.WriteLine("我是人"); } } public class Student : Per... 阅读全文
posted @ 2009-12-26 10:48 ^特殊П佀命^ 阅读(255) 评论(1) 推荐(0) 编辑