how can we check any file is password protect or not in c#
Loading
how can we check any file is password protect or not in c#
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted May 26, 2023, 7:13 PM
There is a Nuget package for System.IO.Packaging. I do not know if it is necessary to install that package. When I install it I then get an error saying PackageRelationshipTypes does not exist. Intellisense says I need to install an NPOI package and there are multiple NPOI packages. Therefore if the code provided by Rajkiran Swain works then I think we need an explanation of how to get the System.IO.Packaging namespace.
raj rajPosted May 25, 2023, 7:09 AM
Hi naimish your code is not working
raj rajPosted May 25, 2023, 6:44 AM
@rajkiran code is not working keyword PackageRelationshipTypes is unknown
Naimish MakwanaPosted May 25, 2023, 5:10 AM
Try below method:
Thanks
Rajkiran SwainPosted May 25, 2023, 4:49 AM