コード例 #1
0
        /// <summary>
        /// 设置起始行和读取的列索引, 在csv文件中读取数据,通过弹窗选择文件路径。
        /// </summary>
        /// <param name="startRow">要读取的起始行索引</param>
        /// <param name="columns">要读取的起始列索引</param>
        /// <param name="rowCount">要读取的行数,若小于等于0则读取全部行</param>
        /// <param name="encoding">编码方式</param>
        public static T[,] Read <T>(long startRow, long[] columns, long rowCount = 0, Encoding encoding = null)
        {
            string filePath = FileUtil.GetOpenFilePathFromDialog(FileExtName);

            return(Read <T>(filePath, startRow, columns, rowCount, encoding));
        }
コード例 #2
0
        public static uint[,] ReadUIntData(uint startRow = 0, uint startColumn = 0, uint rowCount = 0, Encoding encoding = null)
        {
            string filePath = FileUtil.GetOpenFilePathFromDialog(FileExtName);

            return(ReadUIntData(filePath, startRow, startColumn, rowCount, encoding));
        }
コード例 #3
0
        public static ushort[,] ReadUShortData(uint startRow, uint[] columns, uint rowCount = 0, Encoding encoding = null)
        {
            string filePath = FileUtil.GetOpenFilePathFromDialog(FileExtName);

            return(ReadUShortData(filePath, startRow, columns, rowCount, encoding));
        }
コード例 #4
0
        /// <summary>
        /// 在csv文件中设置要读取的行列索引值数组,读取二维数组,通过弹窗选择文件路径。
        /// </summary>
        /// <param name="rows">要读取的行的索引集合</param>
        /// <param name="columns">要读取的列的索引集合</param>
        /// <param name="encoding">编码方式</param>
        /// <returns></returns>
        public static T[,] Read <T>(long[] rows, long[] columns, Encoding encoding = null)
        {
            string filePath = FileUtil.GetOpenFilePathFromDialog(FileExtName);

            return(Read <T>(filePath, rows, columns, encoding));
        }
コード例 #5
0
        /// <summary>
        /// 在csv文件中设置要读取的行列索引值,读取一维数组,文件路径通过文件选择窗口配置
        /// </summary>
        /// <typeparam name="T">数据类型</typeparam>
        /// <param name="majorOrder">读取数值的方向</param>
        /// <param name="index">读取的行/列索引值</param>
        /// <param name="startIndex">要读取的行/列的起始索引位置</param>
        /// <param name="readCount">读取的数组长度,若小于等于0则读取全部</param>
        /// <param name="encoding">编码方式</param>
        /// <returns></returns>
        public static T[] Read <T>(MajorOrder majorOrder, long index, long startIndex = 0, long readCount = 0, Encoding encoding = null)
        {
            string filePath = FileUtil.GetOpenFilePathFromDialog(FileExtName);

            return(Read <T>(filePath, majorOrder, index, startIndex, readCount, encoding));
        }
コード例 #6
0
        /// <summary>
        /// 在bin文件中读取数据为二维double数组文件中读取数据为二维string数组,通过弹窗选择文件路径。
        /// Read data from binary file as two dimensional string array. File path can be choosen from the GUI.
        ///     <returns >
        ///         <para>The read two dimensional double array</para>
        ///         <para>Chinese Simplified:读取后的二维double数组</para>
        ///     </returns>
        /// </summary>
        public static int[,] ReadIntData(int colNum)
        {
            string filePath = FileUtil.GetOpenFilePathFromDialog(FileExtName);

            return(ReadIntData(filePath, colNum));
        }
コード例 #7
0
        /// <summary>
        /// 在bin文件中读取数据为二维double数组文件中读取数据为二维string数组,通过弹窗选择文件路径。
        /// Read data from binary file as two dimensional string array. File path can be choosen from the GUI.
        ///     <returns >
        ///         <para>The read two dimensional double array</para>
        ///         <para>Chinese Simplified:读取后的二维double数组</para>
        ///     </returns>
        /// </summary>
        public static ushort[] ReadUShortData()
        {
            string filePath = FileUtil.GetOpenFilePathFromDialog(FileExtName);

            return(ReadUShortData(filePath));
        }
コード例 #8
0
        /// <summary>
        /// 在bin文件中读取数据为二维double数组文件中读取数据为二维string数组,通过弹窗选择文件路径。
        /// Read data from binary file as two dimensional string array. File path can be choosen from the GUI.
        ///     <returns >
        ///         <para>The read two dimensional double array</para>
        ///         <para>Chinese Simplified:读取后的二维double数组</para>
        ///     </returns>
        /// </summary>
        public static double[] ReadDoubleData()
        {
            string filePath = FileUtil.GetOpenFilePathFromDialog(FileExtName);

            return(ReadDoubleData(filePath));
        }
コード例 #9
0
 /// <summary>
 /// 流式读取的构造方法
 /// </summary>
 public BinHandler()
 {
     this._filePath = FileUtil.GetOpenFilePathFromDialog(FileExtName);
     this._readOver = false;
     InitStreamAndReader();
 }
コード例 #10
0
        /// <summary>
        /// 在csv文件中设置起始索引值,读取二维数组,通过弹窗选择文件路径。
        /// </summary>
        /// <param name="startRow">要读取的起始行索引</param>
        /// <param name="startColumn">要读取的起始列索引</param>
        /// <param name="rowSize">要读取的行数,若为-1则读取全部行</param>
        /// <param name="columnSize">要读取的列数,若为-1读取全部列</param>
        /// <param name="encoding">编码方式</param>
        /// <returns></returns>
        public static T[,] Read <T>(long startRow = 0, long startColumn = 0, long rowSize = -1, long columnSize = -1, Encoding encoding = null)
        {
            string filePath = FileUtil.GetOpenFilePathFromDialog(FileExtName);

            return(Read <T>(filePath, startRow, startColumn, rowSize, columnSize, encoding));
        }