代码改变世界

阅读排行榜

缓存依赖

2012-05-02 16:48 by Carl Xing, 238 阅读, 收藏,
摘要: public List<MenuEntity> GetMenus() { List<MenuEntity> menuList = null; SqlCacheDependency sqlDep; if (HttpContext.Current.Cache["menu"] == null) { menuList = new List<MenuEntity>(); using (SqlConnection conn = ne... 阅读全文

邮件发送

2012-07-17 17:59 by Carl Xing, 213 阅读, 收藏,
摘要: 前台界面:后台代码:(不同的邮件主机可能会需要端口号)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.Net.Mail;using System.Net;using System.Threading;namespace Mail{ public partial c... 阅读全文

验证码帮助类

2013-05-07 16:55 by Carl Xing, 206 阅读, 收藏,
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Web;using System.Drawing;using System.IO; /// <summary> /// 登陆验证码帮助类 /// </summary> public class LogonValidateCode { /// <summary> /// 比较验证码 /// </summary> /// <p... 阅读全文

文件下载

2012-05-04 12:23 by Carl Xing, 195 阅读, 收藏,
摘要: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { using (FileStream fs = new FileStream(Server.MapPath("~/123.txt"), FileMode.OpenOrCreate)) { int streamLength = (int)fs.Length; ... 阅读全文

自定义配置节点

2013-01-10 18:04 by Carl Xing, 192 阅读, 收藏,
摘要: 创建工程,添加文件:Program调用,ConfigSection用于配置,Configs为节点集合,Config为实际应用节点。App.Config:<?xml version="1.0" encoding="utf-8" ?><configuration> <configSections> <section name="ConfigSection" type="ConfigurationTest.ConfigSection,ConfigurationTest"/> 阅读全文
上一页 1 ··· 3 4 5 6 7 8 9 下一页