03 2012 档案
摘要:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xml
阅读全文
摘要:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xml
阅读全文
摘要:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xml
阅读全文
摘要:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xml
阅读全文
摘要:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xml
阅读全文
摘要:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xml
阅读全文
摘要:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xml
阅读全文
摘要:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="del.aspx.cs" Inherits="del" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="
阅读全文
摘要:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xml
阅读全文
摘要:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xml
阅读全文
摘要:<%@ Page Title="主页" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Net;namespace 破解Default{ class Program { static void Main(string[] args) { WebClient wc = new WebClient(); wc.Encoding = Encoding.UTF8; for (int i = 0; ...
阅读全文
摘要:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AspNetSession1.aspx.cs" Inherits="AspNetSession1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
阅读全文
摘要:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Cookie1.aspx.cs" Inherits="Cookie1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmln
阅读全文
摘要:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ViewState.aspx.cs" Inherits="ViewState" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html
阅读全文
摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title></head><body><form method="post&qu
阅读全文
摘要:<%@ WebHandler Language="C#" Class="IntValue2" %>using System;using System.Web;public class IntValue2 : IHttpHandler { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/html"; context.Response.Write("Hello World"); s
阅读全文
摘要:<%@ WebHandler Language="C#" Class="IntValue" %>using System;using System.Web;/* 数值自增 * 实现input的自增,点击按钮input中的值自动增加,代码见备注 * 使用aspx重写input的自增 * * */public class IntValue : IHttpHandler { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "
阅读全文
摘要:* Get与Post * 还可以设定form的method属性指定表单提交方式,get(默认值)是通过url传递表单值,post传递的表单值是隐藏到http报文中,url中看到不 * get和post的区别: get是通过url传递表单值,post通过url看不到表单域的值: * get传递的数据量是有限的,如果要传递大数据量不能用get,比如type="file"上传文件,type="password"传递密码或者重新提交表单的问题,get则没有 * * Get方式Url数据格式样,服务端文件名后跟着? 由于客户端可能向服务器端提交多个键值对,键值对之
阅读全文
摘要:<%@ WebHandler Language="C#" Class="IsPostBack" %>using System;using System.Web;public class IsPostBack : IHttpHandler { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/html"; //context.Response.Write("Hello World"
阅读全文
摘要:<%@ WebHandler Language="C#" Class="Hello1" %>using System;using System.Web;public class Hello1 : IHttpHandler { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/html"; //表示响应的数据是html数据 //context.Response.Write("Hello Wo
阅读全文
摘要:WebApplication(web应用程序)和webSite(网站)的区别,webSite是为了兼容从asp转过来的开发人员的习惯而存在的,用起来简单,比如不需要创建命名空间cs代码修改以后不需要重启就能看到变化(无论是website还是webapplication,修改aspx都不需要重启).但是不利于工程化开发,比如代码出错不容易发现,代码不分命名空间,开发技术上没有任何区别,只是开发,调味试习惯不同而已讲简单基础知识面时用website,讲高级技术和做项目的时候用webapplicastion接下来揭示原理, 和好手和aspx暂时告别
阅读全文
摘要:<%@ Page Title="主页" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;/* 课前说明 * 内容: 掌握基于ASP.Net的web开发,ASP.Net内部原理,状态管理(Cookie,Session,ViewState等) * 普通ASP.net控件,数据验证 母版 ListView/Repeater等数据绑定控件 AJAX, 缓存 Membership 导航 自定义控件等 * * 目录: 能够使用A.
阅读全文
摘要:不得不自已写一个.XML的操作一直没有用过.下面是自己搜集的XML操作类DOMDocument相关的内容.属性:Attributes 存储节点的属性列表(只读)childNodes 存储节点的子节点列表(只读)dataType 返回此节点的数据类型Definition 以DTD或XML模式给出的节点的定义(只读)Doctype 指定文档类型节点(只读)documentElement 返回文档的根元素(可读写)firstChild 返回当前节点的第一个子节点(只读)Implementation 返回XMLDOMImplementation对象lastChild 返回当前节点最后一个子节点(只读)
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using _21类型化DataSet_2.DataSet1TableAdapters;using System.Data.SqlClient;/* 弱类型DataSet的缺点 * 只能通过列名引用,dataset.Table[0].Rows[0]
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;/* 可空数据类型 * C#中值类型(int, Guid, bool等)是不可以为空的,int i=null是错误的,因此int, bool等这些类型不能表示数据库中的"Null" * 因此C#提供了"可空类型&quo
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;using System.Configuration;using _17DateStr.DataSet1TableAdapters;/* DataSet * 每次读取的数据都创建连接,执行Co
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Configuration;using System.Data.SqlClient;/* 将连接字符串写在代码中的缺点,多次重复,违反了DRY(Don'i Repeat Yourself)原则,如果要修改连接字符串
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.IO;using System.Data.SqlClient;namespace _8_手机归属地查询案例{ public partial class Form1 : Form { public ...
阅读全文
摘要:这个错误其实是我自己的Sql server没有启动,我还找了一会儿才找到,真笨样,还得多努力!
阅读全文
摘要:using System;using System.Windows.Forms;using System.Data.SqlClient;using System.IO;namespace _8登陆练习操作{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void SetErrorTimes() { using (SqlConnection con...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;/* SQL注入漏洞攻周 * 登陆判断: select * FROM t_users where UserName=... and Password=...,将参数拼到SQL语句中 * 构造恶意的Password: 1' or '1'='1 * 防范注入漏洞攻击的方式:不使用SQL语句拼接,通过参数赋值 * * 查询参数 * SQL语句使用@Us
阅读全文
摘要:--不足:23山东和16山东重复--创建DBPromary数据库create database DBPromaryuse DBPromarygo--创建promary表create table promary(proID int primary key,proName varchar(50) not null)------------------------------------------------------------------------------------------------------------------------------------------中国34个省
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;/* 连接SQLServer * 连接字符串,程序通过连接字符串指定的要连哪些台服务器上的,哪些个实例的哪些个数据库,用什么用户名密码等 * 项目内嵌mdf文件形式的连接字符串 * "Data Source=.\SQLEXPRESS;AttachDBFilename=|DataDirectory|\Database1.mdf;Integrated Security=T
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;/* 执行简单的Insert语句 * SqlCommand表示向服务提交的一个命令(SQL语句等) * CommandText属性为要执行的sql语句,ExecuteNonQuery方法执行一个非查询语句(Update, Insert, Delete等) * using (SqlCommand cmd = conn.CreateCommand()){ * cmd Comm...
阅读全文