// Get the preamble for the Unicode encoder.
// In this case the preamble contains the byte order mark (BOM).
byte[] preamble = unicode.GetPreamble();
// Make sure a preamble was returned
// and is large enough to containa BOM.
if(preamble.Length >= 2)
{
if(preamble[0] == bData[0] && preamble[1] == bData[1])
{
//Read file using "unicode"
}
else
{
//Read file using "gb2312"
}
}
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;
using System.Drawing.Printing;
using System.Data;