示例#1
0
        /// <summary>
        /// 比如WWW读取出csv的文件内容,然后用此方法解析
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static CsvStreamReader ParseCsvText(string str)
        {
            CsvStreamReader reader = new CsvStreamReader();

            reader.LoadCsvString(str);
            return(reader);
        }
示例#2
0
        /// <summary>
        /// 会去读取文件
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="encoding"></param>
        /// <returns></returns>
        public static CsvStreamReader CreateReader(string fileName, Encoding encoding)
        {
            CsvStreamReader reader = new CsvStreamReader
            {
                encoding = encoding,
                fileName = fileName
            };

            reader.LoadCsvFile();
            return(reader);
        }