Ejemplo n.º 1
0
        /// <summary>
        /// 在csv文件中写入数据,通过弹窗选择文件路径,需指定数据类型
        /// </summary>
        /// <typeparam name="T">数据类型</typeparam>
        /// <param name="data">待写入文件的二维数组</param>
        /// <param name="writeMode">文件已存在时的写入模式</param>
        /// <param name="encoding">文件的编码格式。encoding为null时使用系统默认的编码格式</param>
        public static void WriteData <T>(T[,] data, WriteMode writeMode = WriteMode.OverLap, Encoding encoding = null)
        {
            string filePath = FileUtil.GetSaveFilePathFromDialog(FileExtName);

            WriteData(filePath, data, writeMode, encoding);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 在bin文件中写入double类型一维数据,通过弹窗选择文件路径
        /// Write one dimensional data to binary file, file path can be choosen from the pop up GUI.
        ///     <param name="data">
        ///         <para>One dimensional datas to write.</para>
        ///         <para>Chinese Simplified:待写入文件的一维数组</para>
        ///     </param>
        ///     <param name="writeMode">
        ///         <para>Write Mode when file exist.</para>
        ///         <para>Chinese Simplified:文件已存在时的写入模式</para>
        ///     </param>
        /// </summary>
        public static void WriteData(ushort[] data, WriteMode writeMode = WriteMode.OverLap)
        {
            string filePath = FileUtil.GetSaveFilePathFromDialog(FileExtName);

            WriteData(filePath, data, writeMode);
        }