Beispiel #1
0
        //public const long BUFFERSIZE = 640 * 480;
        //public static byte[] gBuffer = new byte[BUFFERSIZE];
        public void RefreshUI()
        {
            // 初始化gBuffer
            //int index = 0;
            //for (int i = 0; i < 480; i++)
            //{
            //    for (int j = 0; j < 640; j++)
            //    {
            //        gBuffer[index++] = 1;
            //    }
            //}
            //byte[] array = binaryReader.ReadBytes(arraySize);
            int arraySize = 480 * 640;

            byte[,] array2 = new byte[480, 640];
            //将一维数组转换为二维数组
            for (int j = 0; j < arraySize; j++)
            {
                array2[j / 640, j % 640] = DataAcquire.gBuffer[j];
            }

            Mat srcG = ConvertFile.ArrayToMat(array2);
            Mat dstG = new Mat();

            Cv2.ApplyColorMap(srcG, dstG, ColormapTypes.Jet);

            Bitmap bitmapG = ConvertFile.MatToBitmap(dstG);

            pictureBox.Image = bitmapG;
        }
 internal ConversionProgressEventArgs(ProgressData progressData, InputBase[] inputs, ConvertFile output)
 {
     Inputs            = inputs;
     Output            = output;
     TotalDuration     = progressData.TotalDuration;
     ProcessedDuration = progressData.ProcessedDuration;
     Frame             = progressData.Frame;
     Fps     = progressData.Fps;
     SizeKb  = progressData.SizeKb;
     Bitrate = progressData.Bitrate;
 }
        public void AddConverted(UnityEngine.Object textFile)
        {
            var convertedFlie = converted.Find(c => c.TextFile == textFile);

            if (convertedFlie == null)
            {
                convertedFlie          = new ConvertFile();
                convertedFlie.TextFile = textFile;
                converted.Add(convertedFlie);
            }
            convertedFlie.SetMD5();
        }
        public async Task <ConvertFile> ConvertAsync(List <InputBase> inputs, ConvertFile output, GlobalOptions globalOptions, PageOptions pageOptions, CancellationToken cancellationToken = default)
        {
            var parameters = new WKHtmltopdfParameters
            {
                Task          = Enums.WKHtmltopdfTask.Convert,
                InputFiles    = inputs.ToArray(),
                OutputFile    = output,
                GlobalOptions = globalOptions,
                PageOptions   = pageOptions
            };

            await ExecuteAsync(parameters, cancellationToken);

            return(parameters.OutputFile);
        }
        public async Task WK_ConvertAsync_url()
        {
            string message         = null;
            WKHtmltoPdfProvider wk = new WKHtmltoPdfProvider();

            wk.Error += (sender, e) => {
                message = e.Exception.Message;
            };

            var f1 = new InputUrl("http://www.baidu.com");
            var f2 = new ConvertFile("baidu.pdf");
            var f4 = await wk.ConvertAsync(f1, f2, null, null);

            var flag = File.Exists(f4.FileInfo.FullName);

            Assert.True(flag);
        }
Beispiel #6
0
        private void WoBomInfo_Load(object sender, EventArgs e)
        {
            #region 添加应用程序
            if (this.mFrm.gUserInfo.rolecaption == "系统开发员")
            {
                IList <IDictionary <string, object> > lsfunls = new List <IDictionary <string, object> >();
                FrmBLL.publicfuntion.GetFromCtls(this, ref lsfunls);
                Dictionary <string, object> dic = new Dictionary <string, object>();
                dic.Add("PROGID", this.Name);
                dic.Add("PROGNAME", this.Text);
                dic.Add("PROGDESC", this.Text);
                FrmBLL.publicfuntion.AddProgInfo(dic, lsfunls);
            }
            #endregion

            FileConvert = new ConvertFile(Readtxtfile);
            FileConvert.BeginInvoke(null, null);
        }
Beispiel #7
0
        private void StopRecord(object sender, MouseButtonEventArgs e)
        {
            string numberrecord = "";
            var    k            = from a in de.VIDEORECORDs
                                  select a;

            numberrecord = string.Format("Record{0}", k.Count() + 1);
            string desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

            playrecord.Visibility = Visibility.Visible;
            stoprecord.Visibility = Visibility.Hidden;
            RecordAudioSystem.StopRecord();
            RecordYourVoice.StopRecord();

            ConvertFile.NAudioMp3ToWav("C:\\ShareFolderMusic\\Record\\system.mp3", "C:\\ShareFolderMusic\\Record\\tempt.wav");
            ConvertFile.MixWavFiles(new string[] { "C:\\ShareFolderMusic\\Record\\tempt.wav", "C:\\ShareFolderMusic\\Record\\voice.wav" }, string.Format("C:\\ShareFolderMusic\\Record\\{0}_{1}.wav", lbtenbaihat.Text, numberrecord));
            string output = desktop + "\\" + lbtenbaihat.Text + "_" + numberrecord + ".wav";
            string input  = "C:\\ShareFolderMusic\\Record\\" + lbtenbaihat.Text + "_" + numberrecord + ".wav";

            File.Copy(input, output);
        }
 public ConversionCompleteEventArgs(InputBase[] inputs, ConvertFile output, string meessge = null)
 {
     Inputs  = inputs;
     Output  = output;
     Message = meessge;
 }
        public ActionResult UpFile(HttpPostedFileBase file, int sk = -1)
        {
            // 没有文件上传,直接返回
            if (file == null || string.IsNullOrEmpty(file.FileName) || file.ContentLength == 0)
            {
                return(HttpNotFound());
            }

            //获取文件完整文件名(包含绝对路径)
            //文件存放路径格式:/files/upload/{日期}/{Guid+文件名}.{后缀名}
            //例如:/files/upload/20130913/43CA215D947F8C1F1DDFCED383C4D706.jpg
            //string str = Filedata.FileName.Substring(0, Filedata.FileName.LastIndexOf('.'));
            string fileName       = Guid.NewGuid().ToString("N");
            string fileEextension = Path.GetExtension(file.FileName);
            string uploadDate     = DateTime.Now.ToString("yyyyMMdd");

            if (file.ContentType.Contains("image"))
            {
                var virtualOriginalPath = string.Format("~/UploadFiles/images/{0}/Original/{1}{2}", uploadDate, fileName,
                                                        fileEextension);//原图片路径

                var virtualThumbnailPath = string.Format("~/UploadFiles/images/{0}/Thumbnail/{1}{2}", uploadDate, fileName,
                                                         fileEextension);//缩略图路径
                string fullOriginaFileName   = this.Server.MapPath(virtualOriginalPath);
                string fullThumbnailFileName = this.Server.MapPath(virtualThumbnailPath);
                //创建文件夹,保存文件
                string path = Path.GetDirectoryName(fullOriginaFileName);
                if (path != null)
                {
                    Directory.CreateDirectory(path);
                    if (!System.IO.File.Exists(fullOriginaFileName))
                    {
                        file.SaveAs(fullOriginaFileName);
                    }
                }

                path = Path.GetDirectoryName(fullThumbnailFileName);
                if (path != null)
                {
                    Directory.CreateDirectory(path);
                }
                ImageClass.Compress(fullOriginaFileName, fullThumbnailFileName);//压缩图片
                if (sk != 0)
                {
                    Common.FileOperate.FileDel(fullOriginaFileName);
                }
                dynamic data = new
                {
                    OriginalPath  = virtualOriginalPath.Remove(0, 1),
                    ThumbnailPath = virtualThumbnailPath.Remove(0, 1)
                };
                return(Json(SysEnum.成功, data, "图片上传成功"));
            }
            else if (fileEextension == ".mp3" || fileEextension == ".mp4" || fileEextension == ".wav" || fileEextension == ".wma" || fileEextension == ".aiff" ||
                     fileEextension == ".amr" || fileEextension == ".m4a" || fileEextension == ".rm" ||
                     fileEextension == ".rmvb" || fileEextension == ".avi" || fileEextension == ".3gp" ||
                     fileEextension == ".ogg" || fileEextension == ".mpeg" || fileEextension == ".swf" ||
                     fileEextension == ".flv" || fileEextension == ".vob" || fileEextension == ".mkv" ||
                     fileEextension == ".raw")
            {
                var virtualOriginalPath = string.Format("~/UploadFiles/video/{0}/Original/{1}{2}", uploadDate, fileName,
                                                        fileEextension); //原文件虚拟路径

                var virtualThumbnailPath = string.Format("~/UploadFiles/video/{0}/HandledPath/{1}{2}", uploadDate, fileName, fileEextension);
                //转换后的虚拟路径
                string fullOriginaFileName = this.Server.MapPath(virtualOriginalPath);
                //创建文件夹,保存文件
                string path = Path.GetDirectoryName(fullOriginaFileName);
                if (path != null)
                {
                    Directory.CreateDirectory(path);
                    if (!System.IO.File.Exists(fullOriginaFileName))
                    {
                        file.SaveAs(fullOriginaFileName);
                    }
                }
                //mp3,wma,aiff,arm,m4a
                if (fileEextension == ".mp3" || fileEextension == ".wav" || fileEextension == ".wma" || fileEextension == ".aiff" ||
                    fileEextension == ".amr" || fileEextension == ".m4a") //这些格式就是音频文件啦
                {
                    virtualThumbnailPath = ConvertFile.ConvertFileFormat("/bin/ffmpeg.exe", fullOriginaFileName,
                                                                         virtualThumbnailPath + ".mp3"); //去转换格式,返回 新文件.mp3
                    if (virtualThumbnailPath == "格式转换失败!")                                               //转换失败
                    {
                        dynamic data = new
                        {
                            OriginalPath  = virtualOriginalPath.Remove(0, 1),
                            ThumbnailPath = ""
                        };
                        return(Json(SysEnum.其他错误, data, "上传成功,格式转换失败!"));
                    }
                    else
                    {
                        dynamic data = new
                        {
                            OriginalPath  = virtualOriginalPath.Remove(0, 1),
                            ThumbnailPath = ""
                        };
                        return(Json(SysEnum.成功, data, "上传成功,格式转换成功!"));
                    }
                }
                //rm,rmvb,avi,mp4,3gp,ogg,mpeg,swf,flv,vob,mkv,raw,mov
                if (fileEextension == ".mp4" || fileEextension == ".rm" || fileEextension == ".rmvb" || fileEextension == ".avi" ||
                    fileEextension == ".3gp" || fileEextension == ".ogg" || fileEextension == ".mpeg" ||
                    fileEextension == ".swf" || fileEextension == ".flv" || fileEextension == ".vob" ||
                    fileEextension == ".mkv" || fileEextension == ".raw") //视频格式文件
                {
                    virtualThumbnailPath = ConvertFile.ConvertFileFormat("/bin/ffmpeg.exe", fullOriginaFileName,
                                                                         virtualThumbnailPath + ".mp4"); //返回 新文件.mp4
                    if (virtualThumbnailPath == "格式转换失败!")                                               //转换失败
                    {
                        dynamic data = new
                        {
                            OriginalPath  = virtualOriginalPath.Remove(0, 1),
                            ThumbnailPath = ""
                        };
                        return(Json(SysEnum.其他错误, data, "上传成功,格式转换失败!"));
                    }
                    else
                    {
                        dynamic data = new
                        {
                            OriginalPath  = virtualOriginalPath.Remove(0, 1),
                            ThumbnailPath = ""
                        };
                        return(Json(SysEnum.成功, data, "上传成功,格式转换成功!"));
                    }
                }
            }
            else
            {
                var virtualOriginalPath = string.Format("~/UploadFiles/other/{0}/Original/{1}{2}", uploadDate, fileName,
                                                        fileEextension); //原文件虚拟路径
                //转换后的虚拟路径
                string fullOriginaFileName = this.Server.MapPath(virtualOriginalPath);
                //创建文件夹,保存文件
                string path = Path.GetDirectoryName(fullOriginaFileName);
                if (path != null)
                {
                    Directory.CreateDirectory(path);
                    if (!System.IO.File.Exists(fullOriginaFileName))
                    {
                        file.SaveAs(fullOriginaFileName);
                        dynamic data = new
                        {
                            OriginalPath  = virtualOriginalPath.Remove(0, 1),
                            ThumbnailPath = virtualOriginalPath.Remove(0, 1)
                        };
                        return(Json(SysEnum.成功, data, "上传成功!"));
                    }
                }
            }
            return(Json(SysEnum.失败, "上传失败!"));
        }
 public ConversionErrorEventArgs(WKHtmltopdfException exception, InputBase[] inputs, ConvertFile output)
 {
     Exception = exception;
     Inputs    = inputs;
     Output    = output;
 }
 public async Task <ConvertFile> ConvertAsync(InputBase input, ConvertFile output, GlobalOptions globalOptions, PageOptions pageOptions, CancellationToken cancellationToken = default)
 {
     return(await ConvertAsync(new List <InputBase> {
         input
     }, output, globalOptions, pageOptions, cancellationToken));
 }
 public ConversionDataEventArgs(string data, InputBase[] inputs, ConvertFile output)
 {
     Data   = data;
     Inputs = inputs;
     Output = output;
 }
Beispiel #13
0
        public static void Main(string[] args)
        {
            int xStart  = 0;
            int zStart  = 0;
            int xEnd    = 0;
            int zEnd    = 0;
            int yTop    = 256;
            int yBottom = 0;

#if DEBUG
            inDebug = true;
#endif
            if (inDebug)
            {
                Console.WriteLine("Parameters: {0}", args.Length);
                for (int i = 0; i < args.Length; i++)
                {
                    Console.WriteLine("Argument [{0}][{1}]", i, args[i]);
                }
            }
            //IF nothing found run help text
            if (args.Length < 6 || string.IsNullOrWhiteSpace(args[0]) || string.IsNullOrWhiteSpace(args[1]) || args[2] == null || args[3] == null)
            {
                HelpText(args);
                Console.ReadLine();
                Environment.Exit(0);
            }

            if (!int.TryParse(args[2], out xStart))
            {
                Console.WriteLine("Error: XCoordinateStart ({0}) could not be converted to int type (invalid?)", args[2]);
                Console.ReadLine();
                Environment.Exit(0);
            }
            if (!int.TryParse(args[3], out zStart))
            {
                Console.WriteLine("Error: ZCoordinateStart ({0}) could not be converted to int type (invalid?)", args[3]);
                Console.ReadLine();
                Environment.Exit(0);
            }
            if (!int.TryParse(args[4], out xEnd))
            {
                Console.WriteLine("Error: XCoordinateEnd ({0}) could not be converted to int type (invalid?)", args[4]);
                Console.ReadLine();
                Environment.Exit(0);
            }
            if (!int.TryParse(args[5], out zEnd))
            {
                Console.WriteLine("Error: ZCoordinateEnd ({0}) could not be converted to int type (invalid?)", args[5]);
                Console.ReadLine();
                Environment.Exit(0);
            }
            if (args.Length == 8)
            {
                if (!int.TryParse(args[6], out yTop))
                {
                    Console.WriteLine("Error: YHightMax ({0}) could not be converted to int type (invalid?)", args[6]);
                    Console.ReadLine();
                    Environment.Exit(0);
                }
                if (!int.TryParse(args[7], out yBottom))
                {
                    Console.WriteLine("Error: YHightMin ({0}) could not be converted to int type (invalid?)", args[7]);
                    Console.ReadLine();
                    Environment.Exit(0);
                }
            }
            //Load File
            Console.WriteLine("Loading Minecraft files...");
            if (!ConvertFile.LoadWorld(args[0]))
            {
                Console.WriteLine("Unknowen error reading Minecraft files.");
                Console.ReadLine();
                Environment.Exit(0);
            }
            else
            {
                Console.WriteLine("Minecraft files loaded. Setting Bounds...");
                ConvertFile.SetWorldBounds(xStart * 16, zStart * 16, xEnd * 16, zEnd * 16, yTop, yBottom);
                Console.WriteLine("Bounds set.");
                Console.WriteLine("Minecraft files trimming...");

                Stopwatch s0 = Stopwatch.StartNew();
                if (!ConvertFile.TrimWorld())
                {
                    Console.WriteLine("Unknowen error trimming minecraft files.");
                    Console.ReadLine();
                    Environment.Exit(0);
                }
                s0.Stop();
                Console.WriteLine("Minecraft files trimed. [{0}]", s0.Elapsed.ToString());
            }
            Console.WriteLine("Building quick Ref ID Index...");
            Stopwatch s1 = Stopwatch.StartNew();
            ConvertFile.BuildIdIndex();
            s1.Stop();
            Console.WriteLine("Quick Ref ID Index built [{0}]", s1.Elapsed.ToString());
            Console.ReadLine();
            //Test Create Boxes
            Console.WriteLine("Building VMF classes...");
            Stopwatch s2 = Stopwatch.StartNew();
            ConvertFile.GenerateTestBoxSet();
            s2.Stop();
            Console.WriteLine("Quick VMF class list built [{0}]", s2.Elapsed.ToString());
            Console.ReadLine();

            //Test VMF generation
            Console.WriteLine("Testing VMF text generation...");
            StringBuilder testingText = ConvertFile.TestVMFGeneration();
            //Console.WriteLine(testingText.ToString());
            Console.WriteLine("Saving File...");
            ConvertFile.TestVMFGeneration(testingText, args[1]);
            Console.WriteLine("...");
            //Console.ReadLine();
        }
        /// <summary>
        /// 数据转换
        /// </summary>
        /// <param name="fileList"></param>
        /// <param name="IsZip"></param>
        /// <returns></returns>
        public ConvertResult DataConvert(List <ConvertFileList> fileList, string UserID, string OutputCoordName, bool IsZip)
        {
            if (fileList == null || fileList.Count <= 0)
            {
                return(new ConvertResult());
            }

            string ConvertFolder   = ConfigurationManager.AppSettings["ConvertExprotPath"] + Guid.NewGuid().ToString();
            string ConvertTypeName = "";


            string OutCoordFile = "";

            if (OutputCoordName.ToUpper() != "NULL")
            {
                OutCoordFile = GetCoordName(OutputCoordName);
            }

            //  var fileTypeList = _IDicDataCodeRepository.GetAllList().Where(q => q.DataTypeID == "25159792-cdba-11e7-a735-005056bb1c7e").ToList();

            foreach (ConvertFileList f in fileList)
            {
                FileInfo ff = new FileInfo(f.PhysicsFilePath);
                f.ID            = Guid.NewGuid().ToString();
                f.LogicFileName = ff.Name;
                f.ConvertResult = 0;
                try
                {
                    // 检测文件是否存在
                    if (!File.Exists(f.PhysicsFilePath))
                    {
                        f.ConvertMsg    = UtilityMessageConvert.Get("转换文件不存在!");
                        f.ConvertResult = 0;
                        continue;
                    }

                    FileInfo fi = null;
                    // 创建转换保存目录
                    Directory.CreateDirectory(ConvertFolder);
                    if (!Directory.Exists(ConvertFolder))
                    {
                        Directory.CreateDirectory(ConvertFolder);
                    }

                    string newFile = "";

                    // 转换文件
                    switch (f.FileType)
                    {
                    case 1:
                        ConvertTypeName = UtilityMessageConvert.Get("格式转换").Trim();

                        try
                        {
                            string[] Files = (string.IsNullOrEmpty(f.ConvertKey)) ? Mapgis2Arcgis(f.PhysicsFilePath) : FileFormatConvert(ff, f.ConvertKey, OutputFormats.ToList());
                            if (Files != null)
                            {
                                foreach (string s in Files)
                                {
                                    fi = new FileInfo(s);
                                    if (fi.Extension.ToUpper() != ".LOG")
                                    {
                                        newFile = ConvertFolder + "\\" + fi.Name;
                                        if (f.ConvertFilePath != "")
                                        {
                                            newFile = f.ConvertFilePath + "\\" + fi.Name;
                                        }

                                        File.Copy(s, ConvertFolder + "\\" + fi.Name, true);
                                        File.Copy(s, newFile, true);
                                    }

                                    try
                                    {
                                        File.Delete(s);
                                    }
                                    catch
                                    {
                                    }
                                }
                                if (f.ConvertFilePath != "")
                                {
                                    f.ConvertFilePath = f.ConvertFilePath + "\\" + f.LogicFileName.Substring(0, f.LogicFileName.IndexOf('.'));
                                }
                                else
                                {
                                    f.ConvertFilePath = ConvertFolder + "\\" + f.LogicFileName.Substring(0, f.LogicFileName.IndexOf('.'));
                                }
                                f.ConvertFolder = ConvertFolder;
                                f.ConvertResult = 1;
                                f.ConvertMsg    = UtilityMessageConvert.Get("转换成功");
                                //  _logger.Debug(f.LogicFileName + "转换成功");
                            }
                            else
                            {
                                f.ConvertResult = 0;
                                f.ConvertMsg    = UtilityMessageConvert.Get("转换文件失败");
                                //  _logger.Debug(f.LogicFileName + "转换文件失败");
                            }
                        }
                        catch (Exception ex)
                        {
                            f.ConvertResult = 0;
                            f.ConvertMsg    = UtilityMessageConvert.Get("shp文件错误");  // ex.Message;
                            //  _logger.Debug(f.LogicFileName + "shp文件错误");
                        }
                        break;

                    case 2:     // 坐标
                        ConvertTypeName = UtilityMessageConvert.Get("坐标转换").Trim();
                        fi      = new FileInfo(f.PhysicsFilePath);
                        newFile = ConvertFolder + "\\" + fi.Name;
                        if (f.ConvertFilePath != "")
                        {
                            newFile = f.ConvertFilePath + "\\" + fi.Name;
                        }

                        if (f.CoordPoint != null && f.CoordPoint.Length > 0)
                        {
                            CoordTransformHelper ctf = new CoordTransformHelper();

                            if (f.CoordPoint[0].Contains(','))
                            {
                                ErrorMsg = (!ctf.ControlPointTransform(f.PhysicsFilePath, newFile, f.CoordName, f.CoordPoint)) ? UtilityMessageConvert.Get("转换失败") : "";
                            }
                            else
                            {
                                ErrorMsg = (!ctf.SevenParameterTransform(f.PhysicsFilePath, newFile, f.CoordName, f.CoordPoint)) ? UtilityMessageConvert.Get("转换失败") : "";
                            }
                        }
                        else     //维持以前逻辑
                        {
                            VectorCoordTransform(f.PhysicsFilePath, OutCoordFile, newFile);
                        }
                        if (ErrorMsg.Trim().Length > 0 || InfoMsg.Trim() == UtilityMessageConvert.Get("转换失败"))
                        {
                            f.ConvertFilePath = "";
                            f.ConvertMsg      = UtilityMessageConvert.Get("shp文件错误");// ErrorMsg != "" ? ErrorMsg : InfoMsg;
                            f.ConvertResult   = 0;
                        }
                        else
                        {
                            f.ConvertFilePath = newFile;
                            f.ConvertResult   = 1;
                            f.ConvertMsg      = UtilityMessageConvert.Get("转换成功");
                        }
                        ErrorMsg = "";

                        break;

                    case 3:     // 投影
                        ConvertTypeName = UtilityMessageConvert.Get("投影转换".Trim());

                        fi      = new FileInfo(f.PhysicsFilePath);
                        newFile = ConvertFolder + "\\" + fi.Name;
                        if (f.ConvertFilePath != "")
                        {
                            newFile = f.ConvertFilePath + "\\" + fi.Name;
                        }
                        VectorCoordTransform(f.PhysicsFilePath, OutCoordFile, newFile);
                        //iTelluro.DataTools.PrjTransform.VectorCoordTransform(f.PhysicsFilePath, OutCoordFile, newFile, Error, Info);
                        if (ErrorMsg.Trim().Length > 0 || InfoMsg.Trim() == UtilityMessageConvert.Get("转换失败"))
                        {
                            f.ConvertFilePath = "";
                            f.ConvertMsg      = UtilityMessageConvert.Get("shp文件错误"); // ErrorMsg != "" ? ErrorMsg : InfoMsg;
                            f.ConvertResult   = 0;
                        }
                        else
                        {
                            f.ConvertFilePath = newFile;
                            f.ConvertResult   = 1;
                            f.ConvertMsg      = UtilityMessageConvert.Get("转换成功");
                        }
                        ErrorMsg = "";

                        break;

                    default:
                        f.ConvertMsg    = "";
                        f.ConvertResult = 0;
                        continue;
                    }
                }
                catch (Exception ex)
                {
                    f.ConvertMsg    = ex.Message;
                    f.ConvertResult = 0;
                }
            }

            ConvertResult ret = new ConvertResult();

            ret.fileList = fileList;


            bool bAllFail = true;

            foreach (var v in fileList)
            {
                if (v.ConvertResult == 1)
                {
                    bAllFail = false;
                    break;
                }
            }



            if (IsZip == true && bAllFail == false)
            {
                string DownFile = ConvertTypeName.Replace(" ", "") + "_" + DateTime.Now.ToString("yyyyMMddHHmm") + ".ZIP"; // Guid.NewGuid().ToString() + ".ZIP";
                // 压缩转换成功文件
                ZipFile.CreateFromDirectory(ConvertFolder, ConfigurationManager.AppSettings["ConvertExprotPath"] + DownFile);

                try
                {
                    Directory.Delete(ConvertFolder, true);
                }
                catch
                {
                }
                ret.ZipFileName = DownFile;

                InfoEarthFrame.Core.ConvertFile entity = new ConvertFile();
                entity.Id              = Guid.NewGuid().ToString();
                entity.UserID          = UserID;
                entity.PhysicsFilePath = ConfigurationManager.AppSettings["ConvertExprotPath"] + DownFile;
                FileInfo fi = new FileInfo(ConfigurationManager.AppSettings["ConvertExprotPath"] + DownFile);
                entity.FileName = ConvertTypeName + "_" + DateTime.Now.ToString("yyyyMMdd HH:mm");
                foreach (ConvertFileList r in ret.fileList)
                {
                    if (r.ConvertResult == 1)
                    {
                        FileInfo rFi = new FileInfo(r.PhysicsFilePath);
                        entity.ConvertFileNames += rFi.Name.Substring(0, rFi.Name.IndexOf('.')) + ",";
                    }
                }
                if (entity.ConvertFileNames.Length > 0)
                {
                    entity.ConvertFileNames = entity.ConvertFileNames.Remove(entity.ConvertFileNames.Length - 1);
                }
                entity.CreateTime = DateTime.Now;
                entity.FileType   = ret.fileList[0].FileType;// FileTypeToNumber();

                try
                {
                    Insert(entity);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

            if (IsZip == true)
            {
                // 添加空间参考
                for (int i = 0; i < fileList.Count; i++)
                {
                    if (fileList[i].ConvertResult == 1)
                    {
                        string ff = fileList[i].ConvertFilePath;
                        if (fileList[i].ConvertFilePath.Substring(fileList[i].ConvertFilePath.Length - 3).ToUpper() != "SHP")
                        {
                            ff += ".shp";
                        }
                        try
                        {
                            ShpReader sr  = new ShpReader(ff);
                            string    wkt = sr.GetSridWkt();
                            if (!string.IsNullOrEmpty(wkt))
                            {
                                SpatialReference srf     = new SpatialReference(wkt);
                                string           strHTML = srf.__str__().Replace("\n", "<br/>").Replace("[\"", ":").Replace("]", "");
                                fileList[i].CoordName = wkt.Substring(wkt.IndexOf("\"") + 1, wkt.IndexOf(",") - wkt.IndexOf("\"") - 2);
                                fileList[i].WKT       = strHTML;
                            }
                        }
                        catch
                        {
                            fileList[i].CoordName = "";
                            fileList[i].WKT       = "";
                        }
                    }
                }
            }

            return(ret);
        }