예제 #1
0
        private void FileProcess_Click(object sender, EventArgs e)
        {
            string path = @"" + FilePath.Text;
            //Instances of lines of the file, and the class that will get the data

            ProcessFile   processFile;
            FileRW        lines = new FileRW();
            StringBuilder sb    = new StringBuilder();
            string        targetPath;

            try
            {
                //Read
                processFile = new ProcessFile(lines.ReadFile(path));
                sb.AppendLine("Arquivo Lido com suscesso!");
                TextLog.AppendText(sb.ToString());
                //Process
                processFile.CreateConciliation(processFile.Spf);
                sb.AppendLine("Arquivo processado com sucesso!");
                TextLog.Clear();
                TextLog.AppendText(sb.ToString());
                //Write
                targetPath = lines.WriteFile(path, processFile.Conciliations);
                sb.AppendLine("Arquivo gravado com sucesso!");
                sb.AppendLine("Processo Finalizado!");
                TextLog.Clear();
                TextLog.AppendText(sb.ToString());
                //OpenFolder
                Process prc = new Process();
                prc.StartInfo.FileName = targetPath;
                prc.Start();
                path = Path.GetDirectoryName(targetPath);
                prc.StartInfo.WorkingDirectory = path;
                prc.StartInfo.FileName         = path;
                prc.Start();
            }
            catch (IOException ex)
            {
                sb.AppendLine("An error occurred!!");
                sb.AppendLine(ex.Message);
                TextLog.Clear();
                TextLog.AppendText(sb.ToString());
            }
        }
예제 #2
0
 /// <summary>
 /// Compress a string
 /// </summary>
 public static string WebCompress(string Body)
 {
     Log.Clear();
     return(WebCompress(Body, EnumContentType.Mixed));
 }