摘要: C#追加文件 StreamWriter sw = File.AppendText(Server.MapPath(".")+"\\myText.txt"); sw.WriteLine("追逐理想"); sw.WriteLine("kzlll"); sw.WriteLine(".NET笔记"); sw.Flush(); sw.Close();C#拷贝文件 string OrignFile,NewFile; OrignFile = Server.MapPath(".")+" 阅读全文
posted @ 2012-06-18 16:43 陶李公 阅读(180) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Data;using System.Configuration;using System.Web;using System.Net;using System.Text;using System.IO;namespace stroper{ public class tohtml { public tohtml() { } /// <summary> /// 生成静态网页 /// </summary> /// <param >模板相对路径</param> /// <param >生成静态 阅读全文
posted @ 2012-06-18 13:15 陶李公 阅读(373) 评论(1) 推荐(0) 编辑
摘要: session是工作在你的应用程序进程中的。由于Asp.net程序是默认配置,所以Web.Config文件中关于Session的设定如下:<sessionState mode='InProc' stateConnectionString='tcpip=127.0.0.1:42424' sqlConnectionString='data source=127.0.0.1;Trusted_Connection=yes' cookieless='true' timeout='60'/>1、InProc我们会发 阅读全文
posted @ 2012-06-18 10:19 陶李公 阅读(423) 评论(0) 推荐(0) 编辑
摘要: 在写代码前我们先来熟悉.net框架中和事件有关的类和委托,了解C#中预定义事件的处理…… 一、了解C#中的预定义事件处理机制 在写代码前我们先来熟悉.net框架中和事件有关的类和委托,了解C#中预定义事件的处理。 EventArgs是包含事件数据的类的基类,用于传递事件的细节。 EventHandler是一个委托声明如下以下是代码片段:public delegate void EventHandler( object sender , EventArgs e ) 注意这里的参数,前者是一个对象(其实这里传递的是对象的引用,如果是button1的click事件则sender就是butt... 阅读全文
posted @ 2012-06-18 10:00 陶李公 阅读(271) 评论(0) 推荐(0) 编辑