Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.37012.4 d17.14
VisualStudioVersion = 17.14.37411.7 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Identify-Word-document-is-Encrypted-or-not", "Identify-Word-document-is-Encrypted-or-not\Identify-Word-document-is-Encrypted-or-not.csproj", "{54A935D7-C09A-697B-0D61-C7AAC43F2784}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Identify-Word-document-is-Encrypted-or-Protected", "Identify-Word-document-is-Encrypted-or-Protected\Identify-Word-document-is-Encrypted-or-Protected.csproj", "{14F884CF-1AC7-B41A-C300-C3991FDE4A7F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{54A935D7-C09A-697B-0D61-C7AAC43F2784}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{54A935D7-C09A-697B-0D61-C7AAC43F2784}.Debug|Any CPU.Build.0 = Debug|Any CPU
{54A935D7-C09A-697B-0D61-C7AAC43F2784}.Release|Any CPU.ActiveCfg = Release|Any CPU
{54A935D7-C09A-697B-0D61-C7AAC43F2784}.Release|Any CPU.Build.0 = Release|Any CPU
{14F884CF-1AC7-B41A-C300-C3991FDE4A7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14F884CF-1AC7-B41A-C300-C3991FDE4A7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14F884CF-1AC7-B41A-C300-C3991FDE4A7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14F884CF-1AC7-B41A-C300-C3991FDE4A7F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FCABE1DE-F4AA-4316-AEF1-3C5C985F9610}
SolutionGuid = {F71E08D4-7F59-4261-8BD3-E1D09BE390C0}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Syncfusion.DocIO;
using Syncfusion.DocIO.DLS;
using System;
using System.IO;

namespace Identify_Word_document_is_Encrypted_or_Protected
{
class Program
{
static void Main(string[] args)
{
// Load a Word document.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Data/Template.docx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
try
{
//Open the Word document using stream.
WordDocument document = new WordDocument(fileStream, FormatType.Docx);
ProtectionType protectionType = document.ProtectionType;

if (protectionType != ProtectionType.NoProtection)
Console.WriteLine("The Word document is protected by " + protectionType.ToString());
else
Console.WriteLine("The Word document is not protected.");
}
catch (Exception exception)
{
//Return if Word document is encrypted.
if (exception.Message == "Document is encrypted, password is needed to open the document")
{
Console.WriteLine("The Word document is encrypted, need password to open.");
}
}
}
}
}
}

This file was deleted.

Loading