文件操作:
http://developer.ccidnet.com/pub/disp/Article?columnID=322&articleID=37879&pageNO=1
http://www.cnblogs.com/lovecherry/archive/2005/08/11/125519.html
DataSet 導出Excel:
http://community.csdn.net/Expert/topic/3421/3421991.xml?temp=.3362238
數據導出Excel:
http://community.csdn.net/Expert/topic/3112/3112296.xml?temp=.926861
StreamWriter.Write 寫中文
.aspx
==============================================================================
<asp:TextBox ID="txtFileContent" TextMode="MultiLine" BackColor="#dff8ff" Font-Size="9" Font-Name="新宋體" Width="98%" Rows="30" runat="server"/>
==============================================================================
.cs
讀取
------------------------------------------------------------------------------
StreamReader sr = new StreamReader(File.Open(Server.MapPath(strPath),
FileMode.Open),System.Text.Encoding.GetEncoding("GB2312"));
txtFileContent.Text = sr.ReadToEnd();
sr.Close();
------------------------------------------------------------------------------
寫入
------------------------------------------------------------------------------
FileStream fs = new FileStream(Server.MapPath(strPath),
FileMode.Create,FileAccess.Write,FileShare.None);
StreamWriter sw = new StreamWriter(fs,System.Text.Encoding.GetEncoding("GB2312"));
sw.Write(txtFileContent.Text);
sw.Close();
==============================================================================
將:
<%@ Page language="c#" Codebehind="index.aspx.cs" AutoEventWireup="false" Inherits="RWSGB.Web.index" ResponseEncoding="gb2312"%>
中的 ResponseEncoding="gb2312" 刪除就OK了。