Free Support Forum - aspose.com

How to check .html file is encripted

Hi Team,

I have a html file which is password protected.
How can i check whether it is encrypted.

I am using the following code to check that.
But it is not taking.

  FileFormatInfo info = FileFormatUtil.DetectFileFormat(FileName);
        <span style="color:#2b91af;">FileFormatUtil</span>.LoadFormatToExtension(info.LoadFormat);
        <span style="color:blue;">return</span> info.IsEncrypted;</pre><br>Can you please help me on this<br>

Hi Anish,


Thanks for your inquiry. FileFormatUtil.DetectFileFormat Method detects and returns the information about a format of a document stored in a disk file. It would be great if you please share your HTML file for investigation purposes.


<span lang=“EN-GB” style=“font-size:10.0pt;font-family:“Courier New”;color:#2B91AF;mso-font-kerning:
0pt;mso-no-proof:yes”>FileFormatInfo<span lang=“EN-GB” style=“font-size:
10.0pt;font-family:“Courier New”;mso-font-kerning:0pt;mso-no-proof:yes”> info =
FileFormatUtil.DetectFileFormat(MyDir + “Document.doc”);<o:p></o:p>

Console.WriteLine("The document format is: " + FileFormatUtil.LoadFormatToExtension(info.LoadFormat));

Console.WriteLine("Document is encrypted: " + info.IsEncrypted);

Console.WriteLine("Document has a digital signature: " + info.HasDigitalSignature);

Hi ,Tahir Manzoor
I am not able to attach the .html file with this.
Can you please suggest me how can i share this file

Hi ,Tahir Manzoor,

Here i am attaching the html file as zip

Regards
Anish

Hi Anish,


Thanks for sharing the information. The HTML file format do not contain the encryption as MS Word document contain. HTML do not allow us to set permission like MS Word do. However, you can write C# code which read HTML contents and find following form field.


Please let us know if you have any more queries.