Beispiel #1
0
        static void Main(string[] args)
        {
            ///////////////////////////////////////////////////////////////////////////////
            //介绍性开头
            Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++++++");
            Console.WriteLine("+++    Hour QPE Analysis V1.0                      +++");
            Console.WriteLine("+++++  Supproted By CaoYong 2018.11.12       +++++++++");
            Console.WriteLine("+++++  QQ: 403637605                         +++++++++");
            Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++++++");
            ///////////////////////////////////////////////////////////////////////////////

            ///////////////////////////////////////////////////////////////////////////////
            //打开计时器
            Stopwatch sw = new Stopwatch();  //创建计时器

            sw.Start();                      //开启计数器
            ///////////////////////////////////////////////////////////////////////////////

            ///////////////////////////////////////////////////////////////////////////////
            string appDir = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;                                                                                  //程序启动文件夹

            //string appDir = @"E:/HourQPE_V1/";
            System.Environment.CurrentDirectory = appDir;                                                                                                                     //设置shell所在文件夹
            string logPath   = appDir + @"log/" + DateTime.Now.Year.ToString("d4") + DateTime.Now.Month.ToString("d2") + DateTime.Now.Day.ToString("d2") + @".txt";           //日志文件夹地址
            Log    simpleLog = new Log(logPath);                                                                                                                              //建立log对象,用于日志的记录                                                                                                                               //输出站点ID计算信息

            ///////////////////////////////////////////////////////////////////////////////

            ///////////////////////////////////////////////////////////////////////////////
            try
            {
                ///////////////////////////////////////////////////////////////////////////
                //时间处理(北京时)
                DateTime dtNow = DateTime.Now;                         //程序启动时间(北京时)
                if (args.Length == 0)                                  //实时运算处理
                {
                    dtNow = DateTime.Now;
                    //dtNow = new DateTime(2018, 11, 12, 14, 00, 00);
                }
                else if (args.Length == 1 && args[0].Length == 12)     //指定日期运算处理
                {
                    try
                    {
                        int argYr = int.Parse(args[0].Substring(0, 4));
                        int argMo = int.Parse(args[0].Substring(4, 2));
                        int argDy = int.Parse(args[0].Substring(6, 2));
                        int argHr = int.Parse(args[0].Substring(8, 2));
                        int argMn = int.Parse(args[0].Substring(10, 2));
                        dtNow = new DateTime(argYr, argMo, argDy, argHr, argMn, 0);
                    }
                    catch (Exception ex)
                    {
                        simpleLog.WriteError(ex.Message, 1);
                        simpleLog.WriteError("date args content is not right!", 1);
                        return;
                    }
                }
                else
                {
                    simpleLog.WriteError("date args is not right!", 1);
                    return;
                }
                ///////////////////////////////////////////////////////////////////////////////

                ///////////////////////////////////////////////////////////////////////////////
                //读取控制文件
                string paraFilePath     = appDir + @"para/para.ini";                  //控制文件地址
                string inputSamplePath  = null;                                       //自动站站点数据输入地址
                string outputSamplePath = null;                                       //QPE分析格点输出地址

                if (!File.Exists(paraFilePath))
                {
                    simpleLog.WriteError("para file is not exist!", 1);
                    return;
                }
                else
                {
                    FileStream   paraFS = new FileStream(paraFilePath, FileMode.Open, FileAccess.Read);
                    StreamReader paraSR = new StreamReader(paraFS, Encoding.GetEncoding("gb2312"));
                    {
                        try
                        {
                            string   strTmp      = paraSR.ReadLine();
                            string[] strArrayTmp = strTmp.Split(new char[] { '=' });
                            inputSamplePath  = strArrayTmp[1].Trim();                          //获取输入地址
                            strTmp           = paraSR.ReadLine();
                            strArrayTmp      = strTmp.Split(new char[] { '=' });
                            outputSamplePath = strArrayTmp[1].Trim();                          //获取输出地址
                        }
                        catch
                        {
                            simpleLog.WriteError("para content is not right!", 1);
                            return;
                        }
                    }
                    paraSR.Close();
                    paraFS.Close();
                }
                ///////////////////////////////////////////////////////////////////////////////

                ///////////////////////////////////////////////////////////////////////////////
                string   stainfoPath = appDir + @"info/sta.info";                   //此处以完整第3类数据站点数据为站点信息
                DateTime dtStart     = dtNow.AddHours(-6);
                DateTime dtEnd       = dtNow;
                DateTime dtCurrent   = dtStart;
                while (DateTime.Compare(dtCurrent, dtEnd) <= 0)                    //冗余设置,分析之前6小时至当前的结果
                {
                    DateTime dtInput        = dtCurrent.AddHours(-8);              //原始数据为世界时
                    DateTime dtOutput       = dtCurrent.AddHours(-8);              //输出结果为世界时
                    string   inputFilePath  = StringProcess.DateReplace(inputSamplePath, dtInput, 000);
                    string   outputFilePath = StringProcess.DateReplace(outputSamplePath, dtOutput, 000);

                    if (File.Exists(outputFilePath + ".m4"))  //存在输出文件则不进行分析
                    {
                        dtCurrent = dtCurrent.AddHours(1);
                        continue;
                    }
                    Console.WriteLine("inputPath=" + inputFilePath);
                    Console.WriteLine("OutputPath=" + outputFilePath);
                    ScatterData sdInputData = new ScatterData(stainfoPath);
                    sdInputData.ClearToNum(0.0);
                    sdInputData.ReadValFromMicaps3(inputFilePath);
                    sdInputData.ClearToNumGreaterThan(0.0, 100.0);                 //简单质量控制
                    sdInputData.ClearToNumLessThan(0.0, 0.10);                     //简单质量控制,注意冬季情况的适用性
                    GridData gdOutputData = new GridData(70.0, 140.0, 0.0, 60.0, 0.05, 0.05);
                    gdOutputData.ClearToNum(0.0);
                    gdOutputData = SpatialAnalisis.GressManInterpolationForRain(sdInputData, gdOutputData, 0.2, 2.0, new double[] { 1.0, 0.8, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1 }); //分析25-5公里尺度
                    gdOutputData.WriteFloatValToBin(outputFilePath + ".bin");
                    string strHeader = StringProcess.DateReplace(@"diamond 4 YYYYMMDDHH00_01hour_QPE YYYY MM DD HH NN 000 0.05 0.05 70.0 140.0 0.0 60.0 1401 1201 2.0 -2.0 20.0 1 00", dtOutput, 000);
                    gdOutputData.WriteValToMicaps4(outputFilePath + ".m4", strHeader);


                    ///////////////////////////////////////////////////////////////////////////////
                    //检验程序
                    ScatterData sdFromQPE = new ScatterData(stainfoPath);
                    sdFromQPE.ClearToNum(0.0);
                    sdFromQPE.BilinearInterpolationFromGridData(gdOutputData);
                    double varError = 0.0;
                    for (int n = 0; n < sdFromQPE.StaData.Length; n++)
                    {
                        varError = varError + (sdFromQPE.StaData[n].Value - sdInputData.StaData[n].Value) * (sdFromQPE.StaData[n].Value - sdInputData.StaData[n].Value);
                    }
                    varError = varError / sdFromQPE.StaData.Length;
                    varError = Math.Sqrt(varError);
                    simpleLog.WriteInfo("Error is " + varError, 1);
                    ///////////////////////////////////////////////////////////////////////////////

                    dtCurrent = dtCurrent.AddHours(1);
                }
                ///////////////////////////////////////////////////////////////////////////////
            }
            catch (Exception ex)
            {
                simpleLog.WriteError(ex.Message, 1);
            }
            ///////////////////////////////////////////////////////////////////////////////

            ///////////////////////////////////////////////////////////////////////////////
            sw.Stop();
            simpleLog.WriteInfo("time elasped: " + sw.Elapsed, 1);
            ///////////////////////////////////////////////////////////////////////////////
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            ///////////////////////////////////////////////////////////////////////////////
            //介绍性开头
            Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++++++");
            Console.WriteLine("+++    Download Hour Rain From CmissServer V1.0    +++");
            Console.WriteLine("+++++  Supported By CaoYong 2018.08.29       +++++++++");
            Console.WriteLine("+++++  QQ: 403637605                         +++++++++");
            Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++++++");
            ///////////////////////////////////////////////////////////////////////////////

            ///////////////////////////////////////////////////////////////////////////////
            //打开计时器
            Stopwatch sw = new Stopwatch();  //创建计时器

            sw.Start();                      //开启计数器
            ///////////////////////////////////////////////////////////////////////////////

            ///////////////////////////////////////////////////////////////////////////////
            ///通用设置
            string appDir = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;                                                                              //程序启动文件夹

            //string appDir = @"E:/Test/DownloadHourRainCimissData_V1/";                                                                                                  //程序启动文件夹测试
            Environment.CurrentDirectory = appDir;                                                                                                                        //设置shell启动文件夹
            string logPath   = StringProcess.DateReplace(appDir + "log/YYYYMMDD.txt", DateTime.Now, 000);                                                                 //日志文件夹地址
            Log    simpleLog = new Log(logPath);                                                                                                                          //建立log对象,用于日志的记录                                                                                                                              //输出站点ID计算信息

            ///////////////////////////////////////////////////////////////////////////////

            ///////////////////////////////////////////////////////////////////////////////
            try
            {
                ///////////////////////////////////////////////////////////////////////////
                //时间处理(北京时)
                DateTime dtNow = DateTime.Now;                         //程序启动时间(北京时)
                if (args.Length == 0)                                  //实时运算处理
                {
                    dtNow = DateTime.Now;                              //实际运行
                    //dtNow = new DateTime(2018, 12, 06, 10, 05, 00);  //测试运行
                }
                else if (args.Length == 1 && args[0].Length == 12)     //指定日期运算处理
                {
                    try
                    {
                        dtNow = DateTime.ParseExact(args[0], "yyyyMMddHHmm", System.Globalization.CultureInfo.CurrentCulture);
                    }
                    catch
                    {
                        simpleLog.WriteError("Date Args Content Is Not Right!", 1);
                        return;
                    }
                }
                else
                {
                    simpleLog.WriteError("Date Args Number Is Not Right!", 1);
                    return;
                }
                ///////////////////////////////////////////////////////////////////////////////

                ///////////////////////////////////////////////////////////////////////////////
                //读取控制文件
                string paraFilePath      = appDir + @"para/para.ini";             //控制文件地址
                string r01hStaSamplePath = null;                                  //站点数据保存地址(小时降水)
                if (!File.Exists(paraFilePath))
                {
                    simpleLog.WriteError("Para File Is Not Exist!", 1);
                    return;
                }
                else
                {
                    FileStream   paraFS = new FileStream(paraFilePath, FileMode.Open, FileAccess.Read);
                    StreamReader paraSR = new StreamReader(paraFS, Encoding.GetEncoding("gb2312"));
                    {
                        try
                        {
                            string   strTmp      = paraSR.ReadLine();
                            string[] strArrayTmp = strTmp.Split(new char[] { '=' });
                            r01hStaSamplePath = strArrayTmp[1].Trim();                         //站点数据保存地址
                        }
                        catch
                        {
                            simpleLog.WriteError("Para Content Is Not Right!", 1);
                            return;
                        }
                    }
                    paraSR.Close();
                    paraFS.Close();
                }
                ///////////////////////////////////////////////////////////////////////////////

                ///////////////////////////////////////////////////////////////////////////////
                //下载小时级站点降水
                {
                    Console.WriteLine("Step2: Download Hour Pre Data...");
                    DataQueryClient             client      = new DataQueryClient();
                    string                      userId      = ConCmiss.USERID;
                    string                      pwd         = ConCmiss.PWD;
                    string                      interfaceId = "getSurfEleByTime";
                    Dictionary <String, String> paramsData  = new Dictionary <String, String>
                    {
                        { "dataCode", "SURF_CHN_MUL_HOR" },             // 资料代码
                        { "elements", "Station_Id_d,Lon,Lat,PRE_1h" },  // 检索要素:站号、小时降水
                        { "orderby", "Station_Id_d:ASC" },              // 排序:按照站号从小到大
                        { "times", "20180831030000" }                   // 检索时间
                    };
                    RetArray2D rddata = new RetArray2D();
                    client.initResources();
                    DateTime dtBase = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, dtNow.Hour, 00, 00).AddHours(-8); //下载数据基准时间,并转化为世界时
                    for (int beforeMin = 0; beforeMin <= 60 * 24; beforeMin = beforeMin + 60)                            //冗余设置,下载过去24小时内的逐1小时降水
                    {
                        DateTime dtNeed = dtBase.AddMinutes(-1.0 * beforeMin);                                           //所需下载数据所在时间
                        paramsData["times"] = dtNeed.ToString("yyyyMMddHHmm00");                                         //更新下载参数中时间
                        string outputPath = StringProcess.DateReplace(r01hStaSamplePath, dtNeed, 000);
                        if (File.Exists(outputPath))                                                                     //如果文件存在则不予下载
                        {
                            continue;
                        }
                        client.callAPI_to_array2D(userId, pwd, interfaceId, paramsData, rddata);
                        List <PointData> ltOutput = new List <PointData>();
                        for (int n = 0; n < rddata.data.GetLength(0); n++)
                        {
                            ltOutput.Add(new PointData(rddata.data[n][0].Trim(), double.Parse(rddata.data[n][1]), double.Parse(rddata.data[n][2]), double.Parse(rddata.data[n][3])));
                        }
                        ScatterData sdOutput = new ScatterData(ltOutput.ToArray());
                        sdOutput.ClearToNumGreaterThan(0.0, 100.0);        //简单质量控制
                        sdOutput.ClearToNumLessThan(0.0, 0.0);
                        if (sdOutput.StaData.Length >= 55000)              //如果数据量超过5500条,则认为数据已经完整,则写出数据,否则不予写出,配合更新数据
                        {
                            string strHeader = StringProcess.DateReplace("diamond 3 YYYY年MM月DD日HH时NN分_逐01小时降水 YY MM DD HH  -1 0 1 0 0", dtNeed, 000);
                            sdOutput.WriterToMicaps3(outputPath, strHeader);
                        }
                        Console.Write("\rfinish {0,8:f2} %", 100.0 * (beforeMin) / (60 * 24));
                    }
                    client.destroyResources();
                    Console.WriteLine("\rfinish ok!                              ");
                }
                ///////////////////////////////////////////////////////////////////////////////
            }
            catch (Exception ex)
            {
                simpleLog.WriteError(ex.Message, 1);
            }
            ///////////////////////////////////////////////////////////////////////////////

            ///////////////////////////////////////////////////////////////////////////////
            sw.Stop();
            simpleLog.WriteInfo("Time Elasped: " + sw.Elapsed, 1);
            ///////////////////////////////////////////////////////////////////////////////
        }
        static void Main(string[] args)
        {
            ///////////////////////////////////////////////////////////////////////////////
            //介绍性开头
            Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++++++");
            Console.WriteLine("+++    Download Cmorph From FTP Server V1.0        +++");
            Console.WriteLine("+++++  Supported By CaoYong 2018.08.29       +++++++++");
            Console.WriteLine("+++++  QQ: 403637605                         +++++++++");
            Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++++++");
            ///////////////////////////////////////////////////////////////////////////////

            ///////////////////////////////////////////////////////////////////////////////
            //打开计时器
            Stopwatch sw = new Stopwatch();  //创建计时器

            sw.Start();                      //开启计数器
            ///////////////////////////////////////////////////////////////////////////////

            ///////////////////////////////////////////////////////////////////////////////
            //程序所需变量设置
            string appDir = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;                                   //程序启动文件夹(正式使用)

            //string appDir = @"D:/HourQPE_V2/DownloadCmorphData_V1/";                                                         //程序启动文件夹(调试使用)
            Environment.CurrentDirectory = appDir;                                                                             //设置shell所在目录
            string logPath   = StringProcess.DateReplace(appDir + "log/YYYYMMDD.txt", DateTime.Now, 000);                      //日志文件夹地址
            Log    simpleLog = new Log(logPath);                                                                               //建立log对象,用于日志的记录                                                                                                                                 //输出站点ID计算信息

            ///////////////////////////////////////////////////////////////////////////////

            ///////////////////////////////////////////////////////////////////////////////
            try
            {
                ///////////////////////////////////////////////////////////////////////////
                //时间处理(北京时)
                DateTime dtNow = DateTime.Now;                         //程序启动时间(北京时)
                if (args.Length == 0)                                  //实时运算处理
                {
                    dtNow = DateTime.Now;                              //正式运行
                    //dtNow = new DateTime(2018, 12, 12, 00, 05, 00);  //调试运行
                }
                else if (args.Length == 1 && args[0].Length == 12)     //指定日期运算处理
                {
                    try
                    {
                        dtNow = DateTime.ParseExact(args[0], "yyyyMMddHHmm", System.Globalization.CultureInfo.CurrentCulture);
                    }
                    catch (Exception ex)
                    {
                        simpleLog.WriteError(ex.Message, 1);
                        simpleLog.WriteError("Date Args Content Is Not Right!", 1);
                        return;
                    }
                }
                else
                {
                    simpleLog.WriteError("Date Args Number Is Not Right!", 1);
                    return;
                }
                ///////////////////////////////////////////////////////////////////////////////

                /////////////////////////////////////////////////////////////////////////////
                //读取控制文件
                string paraFilePath     = appDir + @"para/para.ini";                  //控制文件地址
                string remotePathSample = null;                                       //远程下载地址
                string bz2PathSample    = null;                                       //原始bz2保存地址

                if (!File.Exists(paraFilePath))
                {
                    simpleLog.WriteError("Para File Is Not Exist!", 1);
                    return;
                }
                else
                {
                    FileStream   paraFS = new FileStream(paraFilePath, FileMode.Open, FileAccess.Read);
                    StreamReader paraSR = new StreamReader(paraFS, Encoding.GetEncoding("gb2312"));
                    {
                        try
                        {
                            string   strTmp      = paraSR.ReadLine();
                            string[] strArrayTmp = strTmp.Split(new char[] { '=' });
                            remotePathSample = strArrayTmp[1].Trim();                                       //远程FTP地址
                            strTmp           = paraSR.ReadLine();
                            strArrayTmp      = strTmp.Split(new char[] { '=' });
                            bz2PathSample    = strArrayTmp[1].Trim();                                       //下载ZIP
                        }
                        catch
                        {
                            simpleLog.WriteError("Para Content Is Not Right!", 1);
                            return;
                        }
                    }
                    paraSR.Close();
                    paraFS.Close();
                }
                ///////////////////////////////////////////////////////////////////////////

                ///////////////////////////////////////////////////////////////////////////////
                for (int n = 0; n < 48; n++)                                                       //需要处理下载个数48,也就是下载最近的48小时的cmorph数据
                {
                    try
                    {
                        /////////////////////////////////////////////////////////////////////////////
                        //预备设置
                        DateTime dtBase = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, dtNow.Hour, 00, 00).AddMinutes(-60 * n).AddHours(-8);    //转化为世界时
                        Console.WriteLine("Process Time: " + dtBase);
                        string[] remotePath = new string[1];
                        string[] bz2Path    = new string[1];
                        string[] outputPath = new string[1];
                        remotePath[0] = StringProcess.DateReplace(remotePathSample, dtBase, 00);                                   //远程文件名1
                        bz2Path[0]    = StringProcess.DateReplace(bz2PathSample, dtBase, 00);                                      //bz2文件名1
                        if (!Directory.Exists(Path.GetDirectoryName(bz2Path[0])))                                                  //需要创建bz2文件夹
                        {
                            Directory.CreateDirectory(Path.GetDirectoryName(bz2Path[0]));
                        }
                        /////////////////////////////////////////////////////////////////////////////

                        ///////////////////////////////////////////////////////////////////////////////
                        //下载数据
                        Console.WriteLine("Step1: Download The CMORPH bz2 Files...");
                        for (int i = 0; i < remotePath.Length; i++)
                        {
                            if (!File.Exists(bz2Path[i]) || new FileInfo(bz2Path[i]).Length < 1024)  //如果本地不存在文件,或者存在文件小于1024字节,则进行下载
                            {
                                /*
                                 * //下载方法2,利用axel多线程下载,Linux下解压方式
                                 * //Linux下载
                                 * Process p = new Process();
                                 * p.StartInfo.FileName = "sh";
                                 * p.StartInfo.CreateNoWindow = true;         //不显示程序窗口
                                 * p.StartInfo.UseShellExecute = false;       //是否使用操作系统shell启动
                                 * p.StartInfo.RedirectStandardInput = true;  //接受来自调用程序的输入信息
                                 * p.StartInfo.RedirectStandardOutput = true; //由调用程序获取输出信息
                                 * p.StartInfo.RedirectStandardError = true;  //重定向标准错误输出
                                 * p.Start();//启动程序
                                 * p.StandardInput.WriteLine("axel  -N -q -n 20 -o  " + bz2Path[i] + @" ftp://133.82.233.6/" + remotePath[i]);   //下载数据
                                 * p.StandardInput.WriteLine(@"exit");
                                 * p.StandardInput.AutoFlush = true;
                                 * p.StandardOutput.ReadToEnd();
                                 * p.StandardError.ReadToEnd();
                                 * p.WaitForExit(); //等待程序结束
                                 */

                                //windows下载
                                Process p = new Process();
                                p.StartInfo.FileName               = "cmd.exe";
                                p.StartInfo.CreateNoWindow         = true;                                                                             //不显示程序窗口
                                p.StartInfo.UseShellExecute        = false;                                                                            //是否使用操作系统shell启动
                                p.StartInfo.RedirectStandardInput  = true;                                                                             //接受来自调用程序的输入信息
                                p.StartInfo.RedirectStandardOutput = true;                                                                             //由调用程序获取输出信息
                                p.StartInfo.RedirectStandardError  = true;                                                                             //重定向标准错误输出
                                p.Start();                                                                                                             //启动程序
                                //p.standardinput.writeline(appdir + "axel/axel.exe -n -q -n 20 -o  " + bz2path[i] + " " + remotepath[i]);   //下载数据
                                p.StandardInput.WriteLine(appDir + "wget/wget.exe -N --no-check-certificate -O  " + bz2Path[i] + " " + remotePath[i]); //下载数据
                                p.StandardInput.WriteLine(@"exit");
                                p.StandardInput.AutoFlush = true;
                                p.StandardOutput.ReadToEnd();
                                p.StandardError.ReadToEnd();
                                p.WaitForExit(); //等待程序结束
                            }
                            Console.Write("\rfinish {0,8:f2} % ", 100.0 * (i + 1) / remotePath.Length);
                        }
                        Console.WriteLine("\rfinish ok!                        ");
                        ///////////////////////////////////////////////////////////////////////////////

                        ///////////////////////////////////////////////////////////////////////////////
                        //解压bz2文件
                        Console.WriteLine("Step2: Decode The bz2 Files...");
                        for (int i = 0; i < bz2Path.Length; i++)
                        {
                            /*
                             * //bz2解压,linux下解压方式
                             * Process p = new Process();
                             * p.StartInfo.FileName = "sh";
                             * p.StartInfo.CreateNoWindow = true;         //不显示程序窗口
                             * p.StartInfo.UseShellExecute = false;       //是否使用操作系统shell启动
                             * p.StartInfo.RedirectStandardInput = true;  //接受来自调用程序的输入信息
                             * p.StartInfo.RedirectStandardOutput = true; //由调用程序获取输出信息
                             * p.StartInfo.RedirectStandardError = true;  //重定向标准错误输出
                             * p.Start();//启动程序
                             * p.StandardInput.WriteLine(@"bzip2 -dkf " + bz2Path[i]);   //该程序能判断有无解压过,如果解压过就不在进一步解压一次
                             * p.StandardInput.WriteLine(@"exit");
                             * p.StandardInput.AutoFlush = true;
                             * p.StandardOutput.ReadToEnd();
                             * p.StandardError.ReadToEnd();
                             * p.WaitForExit(); //等待程序结束
                             */

                            //bz2解压, windows下解压方式
                            Process p = new Process();
                            p.StartInfo.FileName               = "cmd.exe";
                            p.StartInfo.CreateNoWindow         = true;                               //不显示程序窗口
                            p.StartInfo.UseShellExecute        = false;                              //是否使用操作系统shell启动
                            p.StartInfo.RedirectStandardInput  = true;                               //接受来自调用程序的输入信息
                            p.StartInfo.RedirectStandardOutput = true;                               //由调用程序获取输出信息
                            p.StartInfo.RedirectStandardError  = true;                               //重定向标准错误输出
                            p.Start();                                                               //启动程序
                            p.StandardInput.WriteLine(appDir + @"gzip/gzip.exe -dkf " + bz2Path[i]); //该程序能判断有无解压过,如果解压过就不在进一步解压一次
                            p.StandardInput.WriteLine(@"exit");
                            p.StandardInput.AutoFlush = true;
                            p.StandardOutput.ReadToEnd();
                            p.StandardError.ReadToEnd();
                            p.WaitForExit(); //等待程序结束

                            Console.Write("\rfinish {0,8:f2} %", 100.0 * (i + 1) / bz2Path.Length);
                        }
                        Console.WriteLine("\rfinish ok!                              ");
                        ///////////////////////////////////////////////////////////////////////////////
                    }
                    catch (Exception ex)
                    {
                        simpleLog.WriteError(ex.Message, 1);
                        continue;
                    }
                }// 处理循环
            }
            catch (Exception ex)
            {
                simpleLog.WriteError(ex.Message, 1);
            }
            ///////////////////////////////////////////////////////////////////////////////

            ///////////////////////////////////////////////////////////////////////////////
            sw.Stop();
            simpleLog.WriteInfo("time elasped: " + sw.Elapsed, 1);
            ///////////////////////////////////////////////////////////////////////////////
        }