上一页 1 ··· 5 6 7 8 9
摘要: 方法一://建立StreamWriter为写做准备 StreamWriter rw = File.CreateText(Server.MapPath(".")+"\\CreateText.txt"); //使用WriteLine写入内容 rw.WriteLine("使用File.CreateText 方法"); rw.WriteLine("返回StreamWriter流,利用这个流... 阅读全文
posted @ 2006-10-23 15:11 RobotTech 阅读(1971) 评论(0) 推荐(0) 编辑
摘要: //建立两个FileStream对象 FileStream fsOF = new FileStream(OriginFile,FileMode.Open,FileAccess.Read); FileStream fsNF = new FileStream(NewFile,FileMode.Create,FileAccess.Write); //建立分别建立一个读写类 Binary... 阅读全文
posted @ 2006-10-23 15:09 RobotTech 阅读(1219) 评论(0) 推荐(0) 编辑
摘要: FileInfo fi; DirectoryInfo di; TableCell td; TableRow tr; /* 设定Table中的数据 首先搞定第一行 */ tr = new TableRow(); td = new TableCell(); td.Controls.Add(new LiteralControl("")); tr.Ce... 阅读全文
posted @ 2006-10-23 15:07 RobotTech 阅读(455) 评论(0) 推荐(0) 编辑
摘要: ASPX: 使用全站点计数器 全站点计数器 GlobCount.inc: 阅读全文
posted @ 2006-10-23 13:22 RobotTech 阅读(351) 评论(0) 推荐(0) 编辑
摘要: 存储Image到XML:Byte[] FileByteArray = new Byte[FileLength]; //图象文件临时储存Byte数组 Stream StreamObject = loFile.PostedFile.InputStream; //建立数据流对像 //读取图象文件数据,FileByteArray为数据储存体,0为数据指针位置、FileLnegth为数据长度 ... 阅读全文
posted @ 2006-10-23 12:57 RobotTech 阅读(1055) 评论(0) 推荐(0) 编辑
摘要: private void Page_Load(object sender, System.EventArgs e) { FileStream stream = new FileStream(Server.MapPath("people.xml"), FileMode.Open); //创建XmlValidatingReader类的对象 XmlValidatingReader vr =... 阅读全文
posted @ 2006-10-23 12:51 RobotTech 阅读(348) 评论(0) 推荐(0) 编辑
摘要: static void WriteXMLbyXmlWriter(XmlWriter writer, string symbol, double price, double change, long volume) { writer.WriteStartElement("Stock"); writer.WriteAttributeString("Symbol", symbol); wr... 阅读全文
posted @ 2006-10-23 10:35 RobotTech 阅读(576) 评论(0) 推荐(0) 编辑
摘要: // 创建XmlDocument类的实例 XmlDocument doc = new XmlDocument(); ArrayList NodeValues = new ArrayList(); // 把people.xml文件读入内存,形成一个DOM结构 doc.Load( Server.MapPath("people.xml") ); XmlNode root = doc.... 阅读全文
posted @ 2006-10-23 10:27 RobotTech 阅读(328) 评论(0) 推荐(0) 编辑
摘要: 在C#.net中操作XML //================================================================================== 在C#.net中如何操作XML需要添加的命名空间:using System.Xml; 定义几个公共对象:XmlDocument xmldoc ;XmlNode xmlnode ;XmlElement x... 阅读全文
posted @ 2006-10-21 23:14 RobotTech 阅读(351) 评论(0) 推荐(0) 编辑
摘要: 在C#中操作XML已知有一个XML文件(bookstore.xml)如下: Oberon's Legacy Corets, Eva 5.95 1、往节点中插入一个节点: XmlDocument xmlDoc=new XmlDocument(); xmlDoc.Load("bookstore.xml"); XmlNode root=xmlDoc.Sel... 阅读全文
posted @ 2006-10-21 23:05 RobotTech 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 1、DateTime 数字型 System.DateTime currentTime=new System.DateTime( ); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=currentTime.Month; 1.4 取当前日 int 日=curr... 阅读全文
posted @ 2006-10-21 23:04 RobotTech 阅读(307) 评论(0) 推荐(0) 编辑
摘要: MyFirstAjax.htm:My First Ajax data.xml: 南京 苏州 无锡 常州 镇江 南通 扬州 徐州 杭州 宁波 温州 绍兴 嘉兴 湖州 福州 厦门 广州 深圳 东莞 珠海 济南 青岛 威海 烟台 阅读全文
posted @ 2006-10-21 21:28 RobotTech 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 读取:XmlDocument source = new XmlDocument(); XmlNode objnode; int i; string title,href; //载入新闻列表的XML文件 source.Load(Server.MapPath("contents.xml")); objnode=source.SelectSingleNode("topiclist... 阅读全文
posted @ 2006-10-20 15:58 RobotTech 阅读(437) 评论(1) 推荐(0) 编辑
摘要: protected void Application_Start(Object sender, EventArgs e) { StreamReader rd = new StreamReader(Server.MapPath("counter.txt")); int nNum = int.Parse(rd.ReadLine()); Application.Lock(); ... 阅读全文
posted @ 2006-10-20 14:18 RobotTech 阅读(644) 评论(0) 推荐(1) 编辑
摘要: /// /// 将整个文件夹复制到目标文件夹中。 /// /// 源文件夹 /// 目标文件夹 public static void CopyDir(string srcPath,string aimPath) { try { // 检查目标目录是否以目录分割字符结束如果不是则添加之 if(aimPath[aimPath.Length-1] != Path... 阅读全文
posted @ 2006-10-20 11:51 RobotTech 阅读(1297) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2006-10-19 14:59 RobotTech 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Page_Load: If Not Page.IsPostBack Then '--------------------------下面的是错误的 如果2006-10-31 那么-1月 就是 2006-9-31 所以是错误的 Dim year, month, day As Integer day = Now.Day ... 阅读全文
posted @ 2006-10-19 14:53 RobotTech 阅读(740) 评论(0) 推荐(0) 编辑
摘要: Dim SMS_UploadFiles_Path As String = System.Configuration.ConfigurationSettings.AppSettings("SMS_UploadFiles_Path") 'Dim mPath As String = Server.MapPath(SMS_UploadFiles_Path) + "\" ... 阅读全文
posted @ 2006-10-19 14:43 RobotTech 阅读(6704) 评论(27) 推荐(0) 编辑
摘要: 复制文件:FileInfo fiMyfile = new FileInfo(@"C:\123\456.txt"); if(fiMyfile.Exists) { fiMyfile.CopyTo(@"D:\123\456.txt", true); } 删除文件:FileInfo fiMyfile = new FileInfo(@"C:\123\456... 阅读全文
posted @ 2006-10-19 14:39 RobotTech 阅读(1953) 评论(1) 推荐(0) 编辑
摘要: 从数据库中读取:方法一:SqlCommand Cmd = new SqlCommand("SELECT * FROM student", MyCn);SqlDataAdapter da = new SqlDataAdapter(Cmd);DataSet ds = new DataSet();da.Fill(ds, "student");Byte[] byteBLOBData = new Byte... 阅读全文
posted @ 2006-10-18 21:35 RobotTech 阅读(354) 评论(0) 推荐(0) 编辑
摘要: How to use the MQ?===================================================================================Here is an example to use the MQ: using System;using System.Messaging;using System.Drawing;using Sy... 阅读全文
posted @ 2006-10-17 10:32 RobotTech 阅读(248) 评论(0) 推荐(0) 编辑
摘要: MSMQ(MicroSoft Message Queue,微软消息队列)是在多个不同的应用之间实现相互通信的一种异步传输模式,相互通信的应用可以分布于同一台机器上,也可以分布于相连的网络空间中的任一位置。它的实现原理是:消息的发送者把自己想要发送的信息放入一个容器中(我们称之为Message),然后把它保存至一个系统公用空间的消息队列(Message Queue)中;本地或者是异地的消息接收程序再... 阅读全文
posted @ 2006-10-17 10:15 RobotTech 阅读(1022) 评论(0) 推荐(0) 编辑
摘要: default.aspx 代码: WebForm2 default.aspx.cs代码: using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Web;using System.Web.SessionState;usi... 阅读全文
posted @ 2006-10-11 14:20 RobotTech 阅读(452) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Web;using System.Web.SessionState;using System.Web.UI;using System.Web.UI.WebContr... 阅读全文
posted @ 2006-10-11 14:19 RobotTech 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 主要的不同之处在于当使用Session.Abandon时,会调用Session_End方法(InProc模式下)。当下一个请求到来时将激发Session_Start方法。而Session.Clear只是清除Session中的所有数据并不会中止该Session,因此也不会调用那些方法。 阅读全文
posted @ 2006-10-11 14:19 RobotTech 阅读(415) 评论(0) 推荐(0) 编辑
摘要: <?xml version="1.0" encoding="utf-8" ?><configuration> <appSettings><add key="SMS_UploadFiles_Path" value="E:\SMS_UploadFiles\" /><add key="ConnectionString" value="Provider=SQLOLEDB.1;Persist Security Info=False;User 阅读全文
posted @ 2006-10-11 14:14 RobotTech 阅读(306) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Text;using System.Text.RegularExpressions; namespace text_CS{ /// /// UBB 的摘要说明。 /// public class UBB { public UBB() { // // TODO: 在此处添加构造函数逻辑 // } #region 公共... 阅读全文
posted @ 2006-10-11 14:13 RobotTech 阅读(453) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2006-10-11 14:09 RobotTech 阅读(1685) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9