C#VB.NET 添加、删除PPT幻灯片中的数字签名

C#VB.NET 添加、删除PPT幻灯片中的数字签名,第1张

概述本文介绍如何通过C#及VB.NET代码来添加数字签名到PPT幻灯片文档,以及如何将文档中的数字签名删除。 辅助工具: Spire.Presentation.dll (dll版本为5.11.2) 注意:

本文介绍如何通过C#及VB.NET代码来添加数字签名到PPT幻灯片文档,以及如何将文档中的数字签名删除。

辅助工具:

  Spire.Presentation.dll (dll版本为5.11.2)

注意:2种dll文件下载及引用方法:

方法1:下载包,解压到指定路径,并在VS程序中添加引用Spire.Presentation.dll文件;

方法2:通过Nuget下载。

完成引用后,如下效果:

 

 

 

示例1—添加数字签名到PPT文档

using Spire.Presentation; System; System.Security.Cryptography.X509Certificates;namespace AddDigitalSignature{    class Program    {        static voID Main(string[] args)        {            //加载PPT测试文档            Presentation ppt = new Presentation();            ppt.LoadFromfile("test.pptx");            添加数字签名            X509Certificate2 x509 = new X509Certificate2(cer.pfx",123654);            ppt.AddDigitalSignature(x509,Manager,DateTime.Now);            保存文档            ppt.Savetofile(AddDigitalSignature.pptx);        }    }}

VB.NET

imports Spire.Presentation System.Security.Cryptography.X509Certificatesnamespace AddDigitalSignature    Class Program        Private Shared Sub Main(args As String())            '加载PPT测试文档            Dim ppt New Presentation()            ppt.LoadFromfile()            添加数字签名            Dim x509 New X509Certificate2()            ppt.AddDigitalSignature(x509,DateTime.Now)            )        End Sub    End ClassEnd namespace

数字签名添加效果:

 

示例2—删除PPT文档中的数字签名

C#

 Spire.Presentation; RemoveDigitalSignature{    加载包含数字签名的PPT文档            Presentation ppt = 判断文档是否已签名            if (ppt.IsDigitallySigned == true)            {                移除所有签名                ppt.RemoveAllDigitalSignatures();            }            RemoveDigitalSignature.pptx);        }    }}

VB.NET

 Spire.Presentation RemoveDigitalSignature    加载包含数字签名的PPT文档            If ppt.IsDigitallySigned = True Then                                ppt.RemoveAllDigitalSignatures()            End If            End namespace

 

总结

以上是内存溢出为你收集整理的C#/VB.NET 添加、删除PPT幻灯片中的数字签名全部内容,希望文章能够帮你解决C#/VB.NET 添加、删除PPT幻灯片中的数字签名所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1213448.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-04
下一篇 2022-06-04

发表评论

登录后才能评论

评论列表(0条)

保存