C# .NET में पावरपॉइंट प्रेजेंटेशन को कैसे सुरक्षित करें?

पावरपॉइंट प्रेजेंटेशन को अलग-अलग तरीकों से सुरक्षित किया जा सकता है जैसे वॉटरमार्क लगाकर, सिग्नेचर जोड़कर या इसे केवल पढ़ने के लिए। इस चरण-दर-चरण मार्गदर्शिका में, हम आपको दिखाएंगे कि पासवर्ड का उपयोग करके C# .NET में PowerPoint प्रस्तुति को कैसे सुरक्षित किया जाए।

Aspose.Slides for .NET API Microsoft इंटरऑप की आवश्यकता के बिना C# का उपयोग करके PowerPoint presentation को सुरक्षित करने में आपकी सहायता करता है और इसके लिए Microsoft PowerPoint को स्थापित करने की आवश्यकता नहीं होती है।

सी # में पावरपॉइंट प्रेजेंटेशन को सुरक्षित करने के लिए कदम

  1. Aspose.Slides for .NET NuGet पैकेज का प्रयोग करें
  2. Aspose.Slides और Aspose.Slides.Export नामस्थानों का संदर्भ जोड़ें
  3. Aspose लाइसेंस को SetLicense विधि की मदद से लागू करें
  4. एक Presentation Class इंस्टेंस शुरू करें
  5. एक पासवर्ड के साथ प्रस्तुति को सुरक्षित करने के लिए सुरक्षा प्रबंधक वर्ग की एन्क्रिप्ट विधि का उपयोग करें
  6. अंत में, सेव मेथड और SaveFormat.Pptx प्रॉपर्टी का उपयोग करके पासवर्ड प्रोटेक्टेड प्रेजेंटेशन को सेव करें

सी # में पावरपॉइंट प्रेजेंटेशन को सुरक्षित करने के लिए कोड

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 को कैसे सुरक्षित किया जाए। यह एपीआई पासवर्ड सुरक्षा तक सीमित नहीं है, बल्कि आप पीपीटीएक्स फ़ाइल को सी # में भी लॉक और अनलॉक कर सकते हैं। यह .NET के लिए Aspose.Slides की मदद से C# का उपयोग करके PPTX को सुरक्षित करना एक बहुत ही सरल और आसान कार्य बनाता है।

 हिन्दी