20080326 c# 文件 读写 进销存 http://www.shengfang.org //用BinaryReader 类试试 using System; using System.IO; class MyStream { private const string FILE_NAME = "Test.data"; public static void Main(String[] args) { // Create the new, empty data file. if (File.Exists(FILE_NAME)) { Console.WriteLine("{ 0 } already exists!", FILE_NAME); return; } FileStream fs = new FileStream(FILE_NAME, FileMode.CreateNew); // Create the writer for data. BinaryWriter w = new BinaryWriter(fs); // Write data to Test.data. for (int i = 0; i < 11; i++) { w.Write( (int) i); } w.Close(); fs.Close(); // Create the reader for data. fs = new FileStream(FILE_NAME, FileMode.Open, FileAccess.Read); BinaryReader r = new BinaryReader(fs); // Read data from Test.data. for (int i = 0; i < 11; i++) { Console.WriteLine(r.ReadInt32()); } w.Close(); } }
http://www.mobancms.com/tx/windowtx/ 软件简介:远想WEB版进销存2.0在1.0基础上有很大改进,具体为各大功能模块的细节和细分化。 本软件最大优点为安全稳定易用。 演示版网址: http://jxc.8187.cn 用户名为:admin 密码为:admin 安装步骤 1、安装系统支持为 win2003+sp2 iis 6.0 asp.net 2.0 mssql2000+3p4 2、建站独站的站点并选择ASP.net 2.0支持, 3、给系统用户administrators组添加Authenticated Users为超管 4、给所建站的站点添加asp.net和Authenticated Users读取和写入的权限 5、附加数据库,在SQL企业管理器中的安全性-登录中添加administrators组中的Authenticated Users用户给你所附加的数据库所有权限, 6、打开你所建站的网站试试 http://www.7fbbs.com/avonjxc/main.asp Asp.NET写文件的一个小实例程序。 #region 写文件 /**************************************** * 函数名称:WriteFile * 功能说明:当文件不存时,则创建文件,并追加文件 * 参 数:Path:文件路径,Strings:文本内容 * 调用示列: * string Path = Server.MapPath("Default2.aspx"); * string Strings = "这是我写的内容啊"; * EC.FileObj.WriteFile(Path,Strings); *****************************************/ /// <summary> /// 写文件 /// </summary> /// <param name="Path">文件路径</param> /// <param name="Strings">文件内容</param> public static void WriteFile(string Path, string Strings) { if (!System.IO.File.Exists(Path)) { System.IO.FileStream f = System.IO.File.Create(Path); f.Close(); } System.IO.StreamWriter f2 = new System.IO.StreamWriter(Path, true, System.Text.Encoding.GetEncoding("gb2312")); f2.WriteLine(Strings); f2.Close(); f2.Dispose(); } #endregion http://bbs.wx100.com/thread-27751-1-1.html Linux 上的数据可视化工具 字体:大 中 小 |