PowerPoint 프레젠테이션은 워터마크를 적용하거나 서명을 추가하거나 읽기 전용으로 만드는 것과 같은 다양한 방법으로 보호할 수 있습니다. 이 단계별 가이드에서는 암호를 사용하여 C# .NET에서 PowerPoint 프레젠테이션을 보호하는 방법을 보여줍니다.
Aspose.Slides for .NET API은(는) Microsoft Interop 없이 C#을 사용하여 PowerPoint presentation를 보호하는 데 도움이 되며 Microsoft PowerPoint를 설치할 필요가 없습니다.
C#에서 PowerPoint 프레젠테이션을 보호하는 단계
- Aspose.Slides for .NET NuGet 패키지 사용
- Aspose.Slides 및 Aspose.Slides.Export 네임스페이스에 대한 참조 추가
- SetLicense 메서드를 사용하여 Aspose 라이선스 적용
- Presentation Class 인스턴스 시작
- ProtectionManager 클래스의 Encrypt 메서드를 활용하여 암호로 프레젠테이션 보호
- 마지막으로 Save 메서드와 SaveFormat.Pptx 속성을 사용하여 암호로 보호된 프레젠테이션을 저장합니다.
C#에서 PowerPoint 프레젠테이션을 보호하는 코드
using System; | |
//Install Aspose.Slides for .NET NuGet package | |
//and then utilize the following namespace to | |
//secure PowerPoint presentation | |
using Aspose.Slides; | |
using Aspose.Slides.Export; | |
namespace SecurePowerPointPresentation | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
//Set Aspose license before securing PowerPoint presentation | |
//using Aspose.Slides for .NET | |
Aspose.Slides.License AsposeSlidesLicense = new Aspose.Slides.License(); | |
AsposeSlidesLicense.SetLicense(@"c:\asposelicense\license.lic"); | |
//create an object of Presentation class from Aspose.Slides namespace | |
//and provide the PowerPoint presentation to secure in the constructor | |
Presentation PowerPointPresentationToSecure = new Presentation("PowerPointPresentationToSecure.pptx"); | |
//specify the password with which you want to secure the presentation | |
//this can be taken as input password from the user/admin etc. | |
String PasswordForPresentationSecurity = "8ma2bzdqgo"; | |
//Encrypt or secure the presentation with the password using Encrypt method | |
//with the help of ProtectionManager | |
PowerPointPresentationToSecure.ProtectionManager.Encrypt(PasswordForPresentationSecurity); | |
//Finally, save the output presentation secured with password | |
//provide PPTX as save format | |
PowerPointPresentationToSecure.Save("PresentationSecuredWithPassword.pptx",Aspose.Slides.Export.SaveFormat.Pptx); | |
} | |
} | |
} |
위의 단계와 코드에서 C#을 사용하여 PPTX를 보호하는 방법을 배웠습니다. 이 API는 암호 보호에 국한되지 않고 C#에서 PPTX 파일을 잠그거나 잠금 해제할 수도 있습니다. 이것은 .NET용 Aspose.Slides의 도움으로 C#을 사용한 PPTX 보안을 매우 간단하고 쉬운 작업으로 만듭니다.