2014年4月15日

摘要: 以我的理解原型模式的重点就几个字 用于克隆易变对象设计模式主要是为了解决new对象时的耦合问题,这是要克隆某个易变对象时只要直接传入要克隆的对象就可以实现克隆一下是我复制网上的一些代码 摘自《设计模式之美》 Dennis Gao 设计模式之美:Prototype(原型)索引别名意图结构参与者适用性... 阅读全文
posted @ 2014-04-15 13:44 听哥哥的话 阅读(708) 评论(0) 推荐(0) 编辑

2014年4月12日

摘要: 简单的文件上传的代码html页面的代码 如果要上传,就必须 设置 表单 method=post,而且 enctype=multipart/form-data 一旦设置了 enctype=multipart/form-data,那么浏览器生成请求报文的时候,就会生成 数据分割符 并且更换 请求报文体 的数据 组织格式(使用 分隔符 来 分开不同 html 表单控件的 内容) 一般处理程序C08Upload.ashx的代码using System;using System.Collectio... 阅读全文
posted @ 2014-04-12 14:22 听哥哥的话 阅读(949) 评论(0) 推荐(0) 编辑
摘要: System.IO.StringWriter sw = new System.IO.StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); // reptype.RenderControl(htw);//reptype为要导出的对象,当前是reptype,如果是DataGrid,DataList等都可以 Response.Buffer = true; Response.Clear(); Response.ClearCon... 阅读全文
posted @ 2014-04-12 14:21 听哥哥的话 阅读(349) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace C01文件流{ public partial class Form1 : Form { stri... 阅读全文
posted @ 2014-04-12 14:20 听哥哥的话 阅读(567) 评论(0) 推荐(0) 编辑
摘要: cookie的创建using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace AspDotNet04{ public partial class C10CookieLogin : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { ... 阅读全文
posted @ 2014-04-12 14:18 听哥哥的话 阅读(206) 评论(0) 推荐(0) 编辑
摘要: DELETE E FROM t E where E.id> ( SELECT MIN(X.id) FROM t X WHERE X.name = E.name ); 阅读全文
posted @ 2014-04-12 14:17 听哥哥的话 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-04-12 14:16 听哥哥的话 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 强制另存为文件+扩展名的代码using System;using System.Collections.Generic;using System.Linq;using System.Web;namespace AspDotNet03{ /// /// C11Down 负责 读取请求文件并 提示浏览器 另存为 /// public class C11Down : IHttpHandler { public void ProcessRequest(HttpContext context) { //1.获取要下载的文... 阅读全文
posted @ 2014-04-12 14:15 听哥哥的话 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 数据库帮助类的使用DBhelperusing System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.SqlClient;using System.Reflection;//反射命名空间namespace AjaxCRUD.DAL{ /// /// 数据层 - 数据库 操作类 /// internal class DbHelperSQL { //获得配置文件的连接字符串 public static st... 阅读全文
posted @ 2014-04-12 14:14 听哥哥的话 阅读(1118) 评论(0) 推荐(0) 编辑
摘要: 存储过程分页的全套代码aspx页面的代码using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;namespace AspDotNet07_AjaxCRUD.View{ public partial class WebForm1 : System.Web.UI.Page { p... 阅读全文
posted @ 2014-04-12 14:13 听哥哥的话 阅读(724) 评论(0) 推荐(0) 编辑

导航