收集

文件操作:

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了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章