// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/ namespace Aspose.Cells.Cloud.SDK.Example { using Aspose.Cells.Cloud.SDK.Api; using Aspose.Cells.Cloud.SDK.Request; using System; public partial class CellsApiExample { public void PostProtectWorkbookExample() { CellsApi cellsApi = new CellsApi(Environment.GetEnvironmentVariable("CellsCloudTestClientId"), Environment.GetEnvironmentVariable("CellsCloudTestClientSecret")); PostProtectWorkbookRequest request = new PostProtectWorkbookRequest { name = "Book1.xlsx", protection = new Model.WorkbookProtectionRequest { Password="asposelock", ProtectionType="All"}, folder = "TestData/In" }; cellsApi.PostProtectWorkbook(request); } } } // Obsolete //CellsWorkbookApi instance = new CellsWorkbookApi(GetConfiguration()); //string name = "Book1.xlsx"; //WorkbookProtectionRequest protection = new WorkbookProtectionRequest(); //protection.Password = "123"; //protection.ProtectionType = "All"; //string folder = null; //UpdateDataFile(folder, name); //var response = instance.CellsWorkbookPostProtectDocument(name, protection, folder);