摘要: --------------Program.csusingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Data;usingSystem.IO;usingSystem.Collections;usingSystem.Configuration;namespaceTest{classProgram{staticvoidMain(string[]args){ReadFilerf=newReadFile();string[,]str=null;str=rf.ReadFileTo 阅读全文
posted @ 2011-08-16 23:21 *新*新* 阅读(288) 评论(0) 推荐(0)
摘要: 1. FileStream是一个较为底层的类,只能简单地读文件到缓存区,而StreamReader封装了一些高级方法如ReadLine()2. FileStream可读可写,而StreamReader只能读不能写3. FileStream不能指定编码(因为它看到的只是文件的二进制形式,当然无所谓编码),而StreamReader可以指定编码,一旦指定就不允许再更改,因此编码指定是放在它的构造方法里的。默认编码为System.Text.UTF8Encoding,实际上,在StreamReader的构造方法里,它会对文件进行编码检查,当然也可以不让它检查。4. 若对是对二进制文件进行操作,最好使用 阅读全文
posted @ 2011-08-16 17:57 *新*新* 阅读(2644) 评论(0) 推荐(1)
摘要: 配置文件内容格式:(app.config)<?xml version="1.0" encoding="utf-8" ?><configuration><appSettings> <add key="DemoKey" value="*" /></appSettings></configuration>读语句: String str = ConfigurationManager.AppSettings["DemoKey"];写语 阅读全文
posted @ 2011-08-16 17:55 *新*新* 阅读(235) 评论(0) 推荐(0)