บทนํา

บทความนี้แสดงให้เห็นถึงวิธีที่จะนําไปใช้โครงสร้างการถ่ายโอนแบบฟอร์ม Excel ในธุรกิจโดยใช้ Aspose.Cells LowCode Converters ในแอพ .NET Conversters ให้วิธีการที่เรียบง่ายในการจัดการโครงการถ่ายภาพเอกสารขนาดใหญ่โดยไม่จําเป็นต้องมีการเข้ารหัสอย่างกว้างขวางหรือความรู้ที่ลึกซึ้งเกี่ยวกับกลไกภายในของ Excel

ปัญหาโลกจริง

องค์กรมักจะรวบรวมหลายพันเอกสาร Excel ในรูปแบบที่แตกต่างกันทั่วแผนกสร้างปัญหาความเข้ากันได้เมื่ออัพเกรดระบบหรือมาตรฐานกระบวนการ ผู้จัดการด้านไอทีและผู้เชี่ยวชาญในการถ่ายโอน面临ความท้าทายในการรักษาความสมบูรณ์ของข้อมูลการรักษาสูตรและรูปแบบการรับประกันการปฏิบัติตามความปลอดภัยและการจัดการผลกระทบของการแปลงขนาดใหญ่

ความคิดเห็นเกี่ยวกับโซลูชัน

ใช้ Aspose.Cells LowCode Converters เราสามารถนําไปใช้ยุทธ์การถ่ายโอนที่ครอบคลุมซึ่งแปลงเอกสารระหว่างรูปแบบได้อย่างมีประสิทธิภาพในขณะที่รักษาข้อมูลธุรกิจที่สําคัญ โซลูชันนี้เหมาะสําหรับผู้จัดการด้านไอทีและผู้เชี่ยวชาญในการถ่ายเทที่จําเป็นต้องจัดระเบียบการสอดคล้องแบบฟอร์มที่ซับซ้อนทั่วองค์กรที่มีการละเมิดขั้นต่ําในการดําเนินงาน

ข้อกําหนด

ก่อนที่จะใช้โซลูชันให้แน่ใจว่าคุณมี:

  • Visual Studio 2019 หรือภายหลัง
  • .NET 6.0 หรือเร็วกว่า (เข้ากันได้กับ .NET Framework 4.6.2+)
  • Aspose.Cells สําหรับแพคเกจ .NET ที่ติดตั้งผ่าน NuGet
  • ความเข้าใจพื้นฐานของการเขียนโปรแกรม C#
PM> Install-Package Aspose.Cells

การดําเนินการขั้นตอนขั้นตอน

ขั้นตอน 1: ติดตั้งและตั้งค่า Aspose.Cells

เพิ่มแพคเกจ Aspose.Cells ไปยังโครงการของคุณและรวมพื้นที่ชื่อที่จําเป็น:

using Aspose.Cells;
using Aspose.Cells.LowCode;
using Aspose.Cells.Rendering;
using System;
using System.IO;
using System.Text;

ขั้นตอนที่ 2: การออกแบบกลยุทธ์การ مهاجرتของคุณ

สร้างชั้นบริการการย้ายศูนย์ซึ่งจะจัดการกับประเภทการแปลงที่แตกต่างกัน:

public class ExcelMigrationService
{
    private readonly string _sourceDirectory;
    private readonly string _outputDirectory;
    private readonly string _logPath;
    
    public ExcelMigrationService(string sourceDirectory, string outputDirectory, string logPath)
    {
        _sourceDirectory = sourceDirectory;
        _outputDirectory = outputDirectory;
        _logPath = logPath;
        
        // Ensure output directory exists
        if (!Directory.Exists(_outputDirectory))
            Directory.CreateDirectory(_outputDirectory);
            
        // Ensure result subdirectories exist
        Directory.CreateDirectory(Path.Combine(_outputDirectory, "xlsx"));
        Directory.CreateDirectory(Path.Combine(_outputDirectory, "pdf"));
        Directory.CreateDirectory(Path.Combine(_outputDirectory, "html"));
        Directory.CreateDirectory(Path.Combine(_outputDirectory, "json"));
    }
    
    // Methods to be implemented
}

ขั้นตอนที่ 3: การประมวลผลการถ่ายโอนแบบฟอร์มด้วย SpreadsheetConverter

เพิ่มวิธีการแปลงเพื่อย้ายรูปแบบ Excel:

public void MigrateToModernFormat(string inputFile, SaveFormat targetFormat)
{
    try
    {
        string fileName = Path.GetFileNameWithoutExtension(inputFile);
        string outputFile = Path.Combine(_outputDirectory, "xlsx", $"{fileName}.xlsx");
        
        // Configure options for conversion
        LowCodeLoadOptions lclopts = new LowCodeLoadOptions();
        lclopts.InputFile = inputFile;
        
        LowCodeSaveOptions lcsopts = new LowCodeSaveOptions();
        lcsopts.SaveFormat = targetFormat;
        lcsopts.OutputFile = outputFile;
        
        // Execute the conversion
        SpreadsheetConverter.Process(lclopts, lcsopts);
        
        LogConversion($"Converted {inputFile} to {outputFile} successfully.");
    }
    catch (Exception ex)
    {
        LogConversion($"Error converting {inputFile}: {ex.Message}");
        throw;
    }
}

public void BatchConvertDirectory(SaveFormat targetFormat)
{
    string[] excelFiles = Directory.GetFiles(_sourceDirectory, "*.xls*", SearchOption.AllDirectories);
    int successCount = 0;
    int failureCount = 0;
    
    foreach (string file in excelFiles)
    {
        try
        {
            MigrateToModernFormat(file, targetFormat);
            successCount++;
        }
        catch
        {
            failureCount++;
        }
    }
    
    LogConversion($"Batch conversion completed. Success: {successCount}, Failures: {failureCount}");
}

ขั้นตอน 4: เพิ่มการแปลง PDF สําหรับ Archival

การประยุกต์ใช้การแปลง PDF สําหรับความต้องการของไฟล์:

public void ConvertToPdf(string inputFile, bool onePagePerSheet = true)
{
    try
    {
        string fileName = Path.GetFileNameWithoutExtension(inputFile);
        string outputFile = Path.Combine(_outputDirectory, "pdf", $"{fileName}.pdf");
        
        LowCodeLoadOptions lclopts = new LowCodeLoadOptions();
        lclopts.InputFile = inputFile;
        
        LowCodePdfSaveOptions lcsopts = new LowCodePdfSaveOptions();
        PdfSaveOptions pdfOpts = new PdfSaveOptions();
        pdfOpts.OnePagePerSheet = onePagePerSheet;
        lcsopts.PdfOptions = pdfOpts;
        lcsopts.OutputFile = outputFile;
        
        PdfConverter.Process(lclopts, lcsopts);
        
        LogConversion($"Converted {inputFile} to PDF successfully.");
    }
    catch (Exception ex)
    {
        LogConversion($"Error converting {inputFile} to PDF: {ex.Message}");
        throw;
    }
}

public void BatchConvertToPdf(bool onePagePerSheet = true)
{
    string[] excelFiles = Directory.GetFiles(_sourceDirectory, "*.xls*", SearchOption.AllDirectories);
    
    foreach (string file in excelFiles)
    {
        try
        {
            ConvertToPdf(file, onePagePerSheet);
        }
        catch
        {
            // Failures are logged in the ConvertToPdf method
        }
    }
}

ขั้นตอน 5: การประยุกต์ใช้การแปลง HTML สําหรับการเข้าถึงเว็บ

สร้างการแปลง HTML สําหรับการเข้าถึงเอกสารบนเว็บ:

public void ConvertToHtml(string inputFile, string cellNameAttribute = null)
{
    try
    {
        string fileName = Path.GetFileNameWithoutExtension(inputFile);
        string outputFile = Path.Combine(_outputDirectory, "html", $"{fileName}.html");
        
        LowCodeLoadOptions lclopts = new LowCodeLoadOptions();
        lclopts.InputFile = inputFile;
        
        LowCodeHtmlSaveOptions lcsopts = new LowCodeHtmlSaveOptions();
        HtmlSaveOptions htmlOpts = new HtmlSaveOptions();
        
        if (!string.IsNullOrEmpty(cellNameAttribute))
            htmlOpts.CellNameAttribute = cellNameAttribute;
            
        // Configure to export only the first sheet
        htmlOpts.SheetSet = new Aspose.Cells.Rendering.SheetSet(new int[] { 0 });
        lcsopts.HtmlOptions = htmlOpts;
        lcsopts.OutputFile = outputFile;
        
        HtmlConverter.Process(lclopts, lcsopts);
        
        LogConversion($"Converted {inputFile} to HTML successfully.");
    }
    catch (Exception ex)
    {
        LogConversion($"Error converting {inputFile} to HTML: {ex.Message}");
        throw;
    }
}

ขั้นตอน 6: การประยุกต์ใช้การแปลง JSON สําหรับการรวมข้อมูล

เพิ่มการแปลง JSON สําหรับการรวมข้อมูลกับระบบสมัยใหม่:

public string ConvertToJson(string inputFile)
{
    try
    {
        string fileName = Path.GetFileNameWithoutExtension(inputFile);
        string outputFile = Path.Combine(_outputDirectory, "json", $"{fileName}.json");
        
        LowCodeLoadOptions lclopts = new LowCodeLoadOptions();
        lclopts.InputFile = inputFile;
        
        LowCodeSaveOptions lcsopts = new LowCodeSaveOptions();
        lcsopts.OutputFile = outputFile;
        
        JsonConverter.Process(lclopts, lcsopts);
        
        LogConversion($"Converted {inputFile} to JSON successfully.");
        return outputFile;
    }
    catch (Exception ex)
    {
        LogConversion($"Error converting {inputFile} to JSON: {ex.Message}");
        throw;
    }
}

ขั้นตอน 7: เพิ่มความปลอดภัยด้วย SpreadsheetLocker

การใช้การป้องกันรหัสผ่านสําหรับเอกสารที่ละเอียดอ่อน:

public void SecureDocument(string inputFile, string password)
{
    try
    {
        string fileName = Path.GetFileNameWithoutExtension(inputFile);
        string outputFile = Path.Combine(_outputDirectory, "secured", $"{fileName}_secured.xlsx");
        
        // Ensure secured directory exists
        Directory.CreateDirectory(Path.Combine(_outputDirectory, "secured"));
        
        LowCodeLoadOptions lclopts = new LowCodeLoadOptions();
        lclopts.InputFile = inputFile;
        
        LowCodeSaveOptions lcsopts = new LowCodeSaveOptions();
        lcsopts.SaveFormat = SaveFormat.Xlsx;
        lcsopts.OutputFile = outputFile;
        
        SpreadsheetLocker.Process(lclopts, lcsopts, password, null);
        
        LogConversion($"Secured {inputFile} with password protection successfully.");
    }
    catch (Exception ex)
    {
        LogConversion($"Error securing {inputFile}: {ex.Message}");
        throw;
    }
}

ขั้นตอนที่ 8: การนําไปใช้เอกสารเพื่อความเข้มงวด

เพิ่มความสามารถในการเชื่อมโยงเอกสารสําหรับการจัดเรียงรายงาน:

public void MergeDocuments(List<string> inputFiles, string outputFileName)
{
    try
    {
        string outputFile = Path.Combine(_outputDirectory, $"{outputFileName}.xlsx");
        
        LowCodeMergeOptions lcmOpts = new LowCodeMergeOptions();
        lcmOpts.LoadOptionsProvider = new CustomMergerSourceProvider(inputFiles);
        
        LowCodeSaveOptions lcsopts = new LowCodeSaveOptions();
        lcsopts.OutputFile = outputFile;
        lcsopts.SaveFormat = SaveFormat.Xlsx;
        lcmOpts.SaveOptions = lcsopts;
        
        SpreadsheetMerger.Process(lcmOpts);
        
        LogConversion($"Successfully merged {inputFiles.Count} documents into {outputFile}.");
    }
    catch (Exception ex)
    {
        LogConversion($"Error merging documents: {ex.Message}");
        throw;
    }
}

private class CustomMergerSourceProvider : AbstractLowCodeLoadOptionsProvider
{
    private readonly List<string> _sourceFiles;
    private int _currentIndex = -1;
    
    public CustomMergerSourceProvider(List<string> sourceFiles)
    {
        _sourceFiles = sourceFiles;
    }
    
    public override bool MoveNext()
    {
        _currentIndex++;
        return _currentIndex < _sourceFiles.Count;
    }
    
    public override LowCodeLoadOptions Current
    {
        get
        {
            LowCodeLoadOptions lclopts = new LowCodeLoadOptions();
            lclopts.InputFile = _sourceFiles[_currentIndex];
            return lclopts;
        }
    }
}

ขั้นตอนที่ 9: เพิ่มฟังก์ชั่นการเข้าสู่ระบบ

การประยุกต์ใช้การบันทึกที่ครอบคลุมสําหรับการติดตามการตรวจสอบ:

private void LogConversion(string message)
{
    string logEntry = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss} - {message}";
    File.AppendAllText(_logPath, logEntry + Environment.NewLine);
    Console.WriteLine(logEntry);
}

ขั้นตอน 10: ตัวอย่างการดําเนินการที่สมบูรณ์

นี่คือตัวอย่างการทํางานที่สมบูรณ์ที่แสดงให้เห็นถึงกระบวนการทั้งหมด:

using Aspose.Cells;
using Aspose.Cells.LowCode;
using Aspose.Cells.Rendering;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace EnterpriseExcelMigration
{
    class Program
    {
        static void Main(string[] args)
        {
            // Define paths
            string sourceDirectory = @"C:\SourceExcelFiles";
            string outputDirectory = @"C:\MigratedFiles";
            string logPath = @"C:\Logs\migration_log.txt";
            
            try
            {
                // Initialize migration service
                ExcelMigrationService migrationService = new ExcelMigrationService(
                    sourceDirectory, outputDirectory, logPath);
                
                Console.WriteLine("Starting enterprise Excel migration process...");
                
                // Convert all Excel files to XLSX format
                migrationService.BatchConvertDirectory(SaveFormat.Xlsx);
                
                // Create PDF versions for archival
                migrationService.BatchConvertToPdf(true);
                
                // Generate HTML for web access (sample file)
                string sampleFile = Path.Combine(sourceDirectory, "financial_report.xls");
                if (File.Exists(sampleFile))
                {
                    migrationService.ConvertToHtml(sampleFile, "CellIdentifier");
                }
                
                // Extract data from critical files to JSON for system integration
                List<string> criticalFiles = new List<string>
                {
                    Path.Combine(sourceDirectory, "quarterly_data.xlsx"),
                    Path.Combine(sourceDirectory, "annual_report.xls")
                };
                
                foreach (string file in criticalFiles)
                {
                    if (File.Exists(file))
                    {
                        migrationService.ConvertToJson(file);
                    }
                }
                
                // Secure sensitive documents
                string sensitiveFile = Path.Combine(sourceDirectory, "employee_data.xlsx");
                if (File.Exists(sensitiveFile))
                {
                    migrationService.SecureDocument(sensitiveFile, "SecurePassword123!");
                }
                
                // Merge quarterly reports into annual summary
                List<string> quarterlyReports = new List<string>
                {
                    Path.Combine(sourceDirectory, "Q1_report.xlsx"),
                    Path.Combine(sourceDirectory, "Q2_report.xlsx"),
                    Path.Combine(sourceDirectory, "Q3_report.xlsx"),
                    Path.Combine(sourceDirectory, "Q4_report.xlsx")
                };
                
                // Only proceed if all files exist
                if (quarterlyReports.TrueForAll(File.Exists))
                {
                    migrationService.MergeDocuments(quarterlyReports, "Annual_Summary");
                }
                
                Console.WriteLine("Migration process completed successfully.");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Migration process failed: {ex.Message}");
                File.AppendAllText(logPath, $"{DateTime.Now:yyyy-MM-dd HH:mm:ss} - CRITICAL ERROR: {ex.Message}{Environment.NewLine}");
            }
            
            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }
    }
}

ใช้กรณีและแอปพลิเคชัน

มาตรฐานแบบองค์กร

องค์กรขนาดใหญ่มักจะจําเป็นต้องย้ายจากรูปแบบ Excel ที่แตกต่างกัน (.xls, .xlsm, ฯลฯ) ไปยังรูปแบบ XLSX ที่ทันสมัยเพื่อความเข้ากันได้ที่ดีขึ้นกับระบบปัจจุบันและคุณสมบัติการรักษาความปลอดภัย Aspose.Cells LowCode Converters ช่วยให้ทีมไอทีสามารถประมวลผลหลายพันเอกสารผ่านส่วนต่างๆในขณะที่รักษาสูตรรูปแบบและ macros ตามที่เหมาะสม

การปฏิบัติตามกฎระเบียบและการจัดเก็บ

องค์กรทางการเงินและอุตสาหกรรมที่ควบคุมจะต้องเก็บข้อมูลที่ปลอดภัยและไม่สามารถแก้ไขได้ การแปลงเอกสาร Excel ที่สําคัญเป็น PDF ที่ได้รับการป้องกันด้วยรหัสผ่าน ด้วย Aspose.Cells ให้โซลูชันการจัดเก็บรักษาความปลอดภัยที่ตอบสนองความต้องการในการปฏิบัติตามในขณะที่รับประกันความสมบูรณ์และป้องกันการเปลี่ยนแปลงที่ไม่ได้รับอนุญาต

การปรับปรุงระบบและการบูรณาการ

เมื่ออัพเกรดระบบองค์กรองค์กรต้อง استخراجข้อมูลจากรูปแบบ Excel ที่ได้รับอนุญาโตตุลาการเพื่อรวมกับฐานข้อมูลและแอพพลิเคชันที่ทันสมัย ความสามารถในการแปลง JSON ของ Aspose.Cells ช่วยให้การประดิษฐ์และประมวลผลข้อมูลได้อย่างราบรื่นสําหรับการใช้งานในการใช้งานเว็บเครื่องมือธุรกิจและแพลตฟอร์มสมัยใหม่อื่น ๆ โดยไม่ต้องเข้าสู่ข้อมูลด้วยตนเอง

ความท้าทายและโซลูชั่นทั่วไป

ความท้าทาย 1: การรักษาสูตรและรูปแบบที่ซับซ้อน

โซลูชัน: Aspose.Cells รักษาความสมบูรณ์ของสูตรและรูปแบบที่ซับซ้อนในระหว่างการแปลงรูปแบบ SpreadsheetConverter ช่วยให้การคํานวณการกําหนดค่าและคุณสมบัติ Excel ที่ทันสมัยอื่น ๆ โดยไม่จําเป็นต้องดําเนินการด้วยตนเอง

ความท้าทาย 2: การจัดการปริมาณเอกสารขนาดใหญ่

โซลูชัน: การประมวลผลแพทช์โดยใช้ฉนวนข้อผิดพลาดเพื่อให้แน่ใจว่าข้อบกพร่องในเอกสารเดียวจะไม่หยุดการย้ายทั้งหมด กรอบการถ่ายโอนรวมถึงตัวเลือกการบันทึกที่ครอบคลุมและการประยุกต์ใช้แบบพารามิเนลเพื่อจัดการหลายพันไฟล์ได้อย่างมีประสิทธิภาพ

ความท้าทาย 3: การจัดการขนาดไฟล์และประสิทธิภาพ

โซลูชัน: การตั้งค่าตัวเลือกการแปลงเพื่อเพิ่มขนาดและประสิทธิภาพการผลิต สําหรับการสร้างไฟล์ PDF ตัวเลือก OnePagePerSheet สามารถกําหนดขึ้นอยู่กับความต้องการเอกสาร ในขณะที่ การแปลง HTML สามารถ จํากัด ไปยังแผ่นงานที่เฉพาะเจาะจงเพื่อปรับปรุงประสิทธิภาพในการแสดงผล

การพิจารณาประสิทธิภาพ

  • การประมวลผลไฟล์ในชุดขนาดที่สามารถจัดการได้เพื่อหลีกเลี่ยงการ จํากัด ความจํา
  • การดําเนินการหลายอันตรายสําหรับการประมวลผลแบบสม่ําเสมอของเอกสารอิสระ
  • พิจารณาการจัดหาทรัพยากรเซิร์ฟเวอร์สําหรับการถ่ายโอนขนาดใหญ่ด้วยไฟล์หลายพัน
  • ใช้การไหลของหน่วยความจําสําหรับสถานการณ์ที่มีประสิทธิภาพสูงที่ I / O ของไดรฟ์อาจกลายเป็นขวด

แนวทางที่ดีที่สุด

  • การวิเคราะห์ก่อนการเข้าเมืองอย่างละเอียดเพื่อระบุความซับซ้อนของเอกสารและปัญหาที่อาจเกิดขึ้น
  • การบังคับใช้การรับรองที่ครอบคลุมเพื่อให้แน่ใจว่าข้อมูลสมบูรณ์หลังการย้าย
  • สร้างเส้นทางการตรวจสอบรายละเอียดพร้อมการบันทึกที่แข็งแกร่งเพื่อการปฏิบัติตามกฎระเบียบ
  • ก่อตั้งกลยุทธ์การตอบสนองที่ชัดเจนในกรณีที่ปัญหาการถ่ายโอนถูกค้นพบ
  • การทดสอบกระบวนการถ่ายโอนด้วยตัวอย่างตัวแทนก่อนการดําเนินการเต็มรูปแบบ

การ์ตูนขั้นสูง

สําหรับข้อกําหนดที่ซับซ้อนมากขึ้นพิจารณาการประมวลผลขั้นสูงเหล่านี้:

ฉาก 1: การแปลงแบบกําหนดเองตามรูปแบบ

สําหรับองค์กรที่มีรูปแบบ Excel มาตรฐานที่ต้องการการประมวลผลเฉพาะ:

public void ProcessTemplatedDocuments(string templateFile, List<string> dataFiles, SaveFormat outputFormat)
{
    // Load the template
    Workbook templateWorkbook = new Workbook(templateFile);
    
    foreach (string dataFile in dataFiles)
    {
        try
        {
            // Load data document
            Workbook dataWorkbook = new Workbook(dataFile);
            
            // Custom processing logic to extract data and apply to template
            // ...
            
            // Save using LowCode converters
            string outputFile = Path.Combine(_outputDirectory, 
                $"{Path.GetFileNameWithoutExtension(dataFile)}_processed.xlsx");
                
            LowCodeSaveOptions lcsopts = new LowCodeSaveOptions();
            lcsopts.SaveFormat = outputFormat;
            lcsopts.OutputFile = outputFile;
            
            // Custom processing complete, save the workbook
            MemoryStream ms = new MemoryStream();
            templateWorkbook.Save(ms, SaveFormat.Xlsx);
            ms.Position = 0;
            
            // Convert to final format if needed
            LowCodeLoadOptions lclopts = new LowCodeLoadOptions();
            lclopts.LoadFromStream = ms;
            
            SpreadsheetConverter.Process(lclopts, lcsopts);
            
            LogConversion($"Processed template with data from {dataFile}");
        }
        catch (Exception ex)
        {
            LogConversion($"Error processing template with {dataFile}: {ex.Message}");
        }
    }
}

สภาพแวดล้อม 2: การย้ายที่เพิ่มขึ้นด้วยการตรวจจับการเปลี่ยนแปลง

สําหรับกระบวนการย้ายอย่างต่อเนื่องที่จําเป็นต้องตรวจจับและประมวลผลไฟล์ที่เปลี่ยนแปลงเท่านั้น:

public void PerformIncrementalMigration(string changeLogPath)
{
    Dictionary<string, DateTime> previousMigration = LoadChangeLog(changeLogPath);
    Dictionary<string, DateTime> currentMigration = new Dictionary<string, DateTime>();
    List<string> filesToMigrate = new List<string>();
    
    // Identify changed or new files
    foreach (string file in Directory.GetFiles(_sourceDirectory, "*.xls*", SearchOption.AllDirectories))
    {
        DateTime lastModified = File.GetLastWriteTime(file);
        currentMigration[file] = lastModified;
        
        if (!previousMigration.ContainsKey(file) || previousMigration[file] < lastModified)
        {
            filesToMigrate.Add(file);
        }
    }
    
    // Process only changed files
    foreach (string file in filesToMigrate)
    {
        try
        {
            MigrateToModernFormat(file, SaveFormat.Xlsx);
            ConvertToPdf(file);
            ConvertToJson(file);
        }
        catch (Exception ex)
        {
            LogConversion($"Error during incremental migration of {file}: {ex.Message}");
        }
    }
    
    // Save current state for next incremental migration
    SaveChangeLog(changeLogPath, currentMigration);
    
    LogConversion($"Incremental migration completed. Processed {filesToMigrate.Count} modified files.");
}

private Dictionary<string, DateTime> LoadChangeLog(string changeLogPath)
{
    Dictionary<string, DateTime> result = new Dictionary<string, DateTime>();
    
    if (File.Exists(changeLogPath))
    {
        foreach (string line in File.ReadAllLines(changeLogPath))
        {
            string[] parts = line.Split('|');
            if (parts.Length == 2 && DateTime.TryParse(parts[1], out DateTime timestamp))
            {
                result[parts[0]] = timestamp;
            }
        }
    }
    
    return result;
}

private void SaveChangeLog(string changeLogPath, Dictionary<string, DateTime> changeLog)
{
    List<string> lines = new List<string>();
    
    foreach (var entry in changeLog)
    {
        lines.Add($"{entry.Key}|{entry.Value:yyyy-MM-dd HH:mm:ss}");
    }
    
    File.WriteAllLines(changeLogPath, lines);
}

ข้อสรุป

โดยการนําไปใช้ Aspose.Cells LowCode Converters สําหรับการถ่ายโอนแบบฟอร์ม Excel ผู้จัดการด้านไอทีและผู้เชี่ยวชาญในการถ่ายเทสามารถมาตรฐานรูปแบบเอกสารได้อย่างมีประสิทธิภาพทั่วองค์กรและให้แน่ใจว่ามีการเข้ากันได้กับระบบสมัยใหม่ วิธีนี้ช่วยลดความซับซ้อนทางเทคนิคและความต้องการทรัพยากรของการถ่ายทอดขนาดใหญ่ในขณะที่รักษาความสมบูรณ์ของข้อมูลและความน่าเชื่อถือของเอกชนตลอดกระบวนการ

สําหรับข้อมูลเพิ่มเติมและตัวอย่างเพิ่มเติม โปรดดูที่ Aspose.Cells.LowCode API คําอธิบาย.

More in this category