public static DataSet GetDataSet(string DataSetData) { DataSet ds = new DataSet(); try { var rs = StreamManager.String2MemoryStream(DataSetData); ds.ReadXml(rs); rs.Close(); } catch(Exception ex) { ds = GetDataSetUtf8(DataSetData); } return ds; }
static public MemoryStream String2MemoryStream(string strInput) { byte[] ReadBuffer = System.Text.Encoding.Default.GetBytes(strInput); MemoryStream ReadStread = new MemoryStream(ReadBuffer); return ReadStread; }
保存下来 以防以后用得到