用字节方式编码进行读取行. 关键代码

        private Encoding fileEncoding = Encoding.GetEncoding("GB2312");




                    using (StreamReader sr = new StreamReader(fullName, fileEncoding ))
                    {
 while ((line = sr.ReadLine()) != null)
                        {
                            count++;

                                            byte[] bytes = fileEncoding.GetBytes(line);//extractBytes(line);
                                            int nextStart = 0;

                                                    int iLen = lineArray[j].Length;
                                                    if (j == 0)
                                                    {
                                                        scl.rq = fileEncoding.GetString(bytes, 0, iLen);
                                                        nextStart = 0 + iLen+1;
                                                    }












你可能感兴趣的:(用字节方式编码进行读取行. 关键代码)