标题:什么原因产生乱码!
取消只看楼主
guoke0531
Rank: 1
来 自:连云港
等 级:新手上路
帖 子:10
专家分:0
注 册:2010-3-30
结帖率:100%
已结贴  问题点数:10 回复次数:0 
什么原因产生乱码!
FileStream fsInfo = new FileStream("D:/hl.txt", FileMode.OpenOrCreate, FileAccess.Write);
            StreamWriter swInfo = new StreamWriter(fsInfo, Encoding.Unicode);
            swInfo.Flush();
            swInfo.BaseStream.Seek(0, SeekOrigin.Begin);
            foreach (DataGridViewRow row in this.dataGridView1.Rows)
            {
                string str = String.Empty;
                foreach (DataGridViewCell col in row.Cells)
                {
                    str += col.Value + "";
                }
                str += swInfo.NewLine;
                swInfo.Write(str);

            }

            swInfo.Close();

        }
帮忙修改一下,谢谢!!!
  

搜索更多相关主题的帖子: 乱码 
2010-06-02 13:24



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-309025-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.070798 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved