aspx / 开发原地aspx写GB2312编码文件 12月 21, 20091月 7, 2010 - by 欧阳逍遥 - Leave a Comment C#代码 FileStream fs = new FileStream(Server.MapPath(“config.txt”), FileMode.Create); string url = “outfile=” + outfile + “&outpath=” + outpath; //获得字节数组,用GB2312方式写配置文件,以便与flash兼容 byte[] data =System.Text.Encoding.GetEncoding(“gb2312”).GetBytes(url); //开始写入 fs.Write(data, 0, data.Length); //清空缓冲区、关闭流 fs.Flush(); fs.Close(); fs =null;