asp.net生成文件,如.html.txt等

时间:2009-03-04    点击:1660   

using System.IO;

 方法一

       string txt = Server.MapPath("888.txt");

        FileInfo file = new FileInfo(txt);

        if (file.Exists)
        {
            file.Delete();
        }

        using (StreamWriter sw = file.CreateText())
        {
            sw.WriteLine("静态内容");
        }

方法二

        string txt1 = Server.MapPath("999.html");

        FileInfo file1 = new FileInfo(txt1);

        using (FileStream fs = file1.OpenWrite())
        {
            StreamWriter sw = new StreamWriter(fs, System.Text.Encoding.GetEncoding("GB2312"));
            sw.WriteLine("静态内容");
            sw.Flush();
            sw.Close();
         }

状态栏文字从左依次弹出
JavaScript容错脚本
网页载入页面,显示进度条
鼠标拖动改变表格的宽度
asp.net 操作文件夹
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 All Rights Reserved