• <menu id="w2i4a"></menu>
  • logo Spire.XLS 系列教程

    文檔首頁>>Spire.XLS 系列教程>>Excel .NET組件Spire.XLS教程:在Excel中添加和刪除數(shù)字簽名

    Excel .NET組件Spire.XLS教程:在Excel中添加和刪除數(shù)字簽名


    Spire.XLS for .NET 是一款專業(yè)的 .NET Excel 組件, 它可以用在各種.NET 框架中,包括 .NET Core、ASP.NET 和 Windows Forms 等相關(guān)的.NET 應(yīng)用程序。在Excel表格中圖片也是我們經(jīng)常會使用到的工具,這時我們?nèi)绾问褂肧pire.XLS來完成呢?這就是本系列教程將給大家詳細講解的。

    下載Spire.XLS最新版體驗

    *這么優(yōu)秀的國產(chǎn)工具怎能錯過呢!在線下單專享“一口價”,低至4579元起,立即購買!想要獲取更多福利的朋友可以咨詢在線客服哦~


    添加和刪除數(shù)字簽名

    本文將介紹如何使用Spire.XLS for .NET在Excel中添加和刪除數(shù)字簽名。

    添加數(shù)字簽名

    C#

    using System;
    using System.Security.Cryptography.X509Certificates;
    using Spire.Xls;
    using Spire.Xls.Core.MergeSpreadsheet.Interfaces;
    
    namespace Add_Digital_Signature
    {
        class Program
        {
            static void Main(string[] args)
            {
                //創(chuàng)建Workbook實例
                Workbook workbook = new Workbook();
                //加載Excel文檔
                workbook.LoadFromFile("Sample.xlsx");
    
                //添加數(shù)字簽名
                X509Certificate2 cert = new X509Certificate2("gary.pfx", "e-iceblue");
                DateTime certtime = new DateTime(2020, 7, 1, 7, 10, 36);
                IDigitalSignatures signature = workbook.AddDigitalSignature(cert, "e-iceblue", certtime);
                
                //保存結(jié)果文檔
                workbook.SaveToFile("AddDigitalSignature.xlsx", FileFormat.Version2013);
            }
        }
    }

    VB.NET

    Imports System
    Imports System.Security.Cryptography.X509Certificates
    Imports Spire.Xls
    Imports Spire.Xls.Core.MergeSpreadsheet.Interfaces
    
    Namespace Add_Digital_Signature
        Class Program
            Private Shared Sub Main(ByVal args As String())
                Dim workbook As Workbook = New Workbook()
                workbook.LoadFromFile("Sample.xlsx")
                Dim cert As X509Certificate2 = New X509Certificate2("gary.pfx", "e-iceblue")
                Dim certtime As DateTime = New DateTime(2020, 7, 1, 7, 10, 36)
                Dim signature As IDigitalSignatures = workbook.AddDigitalSignature(cert, "e-iceblue", certtime)
                workbook.SaveToFile("AddDigitalSignature.xlsx", FileFormat.Version2013)
            End Sub
        End Class
    End Namespace

    添加數(shù)字簽名后的文檔截圖:

    Excel .NET組件Spire.XLS教程:在Excel中添加和刪除數(shù)字簽名
    刪除數(shù)字簽名

    C#

    using Spire.Xls;
    
    namespace Delete_Digital_Signature
    {
        class Program
        {
            static void Main(string[] args)
            {
                //創(chuàng)建Workbook實例
                Workbook workbook = new Workbook();
                //加載Excel文檔
                workbook.LoadFromFile("AddDigitalSignature.xlsx");
    
                //刪除文檔中的數(shù)字簽名
                workbook.RemoveAllDigitalSignatures();
    
                //保存結(jié)果文檔
                workbook.SaveToFile("RemoveDigitalSignature.xlsx", FileFormat.Version2013);
            }
        }
    }

    VB.NET

    Imports Spire.Xls
    
    Namespace Delete_Digital_Signature
        Class Program
            Private Shared Sub Main(ByVal args As String())
                Dim workbook As Workbook = New Workbook()
                workbook.LoadFromFile("AddDigitalSignature.xlsx")
                workbook.RemoveAllDigitalSignatures()
                workbook.SaveToFile("RemoveDigitalSignature.xlsx", FileFormat.Version2013)
            End Sub
        End Class
    End Namespace

    刪除數(shù)字簽名后的文檔截圖:

    Excel .NET組件Spire.XLS教程:在Excel中添加和刪除數(shù)字簽名

    慧都是E-iceblue官方友好合作伙伴,如果您對spire.PDF感興趣,可以聯(lián)系在線客服了解具體授權(quán)價格和使用機制。
    掃碼咨詢


    添加微信 立即咨詢

    電話咨詢

    客服熱線
    023-68661681

    TOP
    三级成人熟女影院,欧美午夜成人精品视频,亚洲国产成人乱色在线观看,色中色成人论坛 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();