C# 签署受密码保护的html文件

C# 签署受密码保护的html文件,c#,file-io,password-protection,chilkat,C#,File Io,Password Protection,Chilkat,我有一个受密码保护的HTML文件,我正在使用第三方工具(chilkat)进行签名。 问题是它既没有得到信号,也没有给我任何错误。 如何在代码中标识文件需要密码 这是我的密码 if (!pcSourceFile.EndsWith(".pdf")) { byte[] lcReadByte = null; pSerialNumber = locertTest.SerialNumber;

我有一个受密码保护的HTML文件,我正在使用第三方工具(chilkat)进行签名。 问题是它既没有得到信号,也没有给我任何错误。 如何在代码中标识文件需要密码

这是我的密码

           if (!pcSourceFile.EndsWith(".pdf"))
            {
                byte[] lcReadByte = null;
                pSerialNumber = locertTest.SerialNumber;
                Issuer = locertTest.IssuerCN;
                SignTime = DateTime.Now;
                loCryptoTest.SetSigningCert(locertTest);
                byte[] lcWriteBytes = null;
                lcReadByte = loCryptoTest.ReadFile(pcSourceFile);
                //lcWriteBytes = loCryptoTest.OpaqueSignBytes(lcReadByte);
                lcWriteBytes = loCryptoTest.OpaqueSignBytes(lcReadByte);

                if (lcWriteBytes.Length == 0)
                {

   GlobalStatic.WriteLog(loCryptoTest.LastErrorText, "Opeque Sig nature Error", "Signature");
                    return false;
                }

                loCryptoTest.WriteFile(pcDestFile, lcWriteBytes);
                lcReadByte = null;
                lcWriteBytes = null;

            }

HTML还是PDF?什么是chilkat对象?您可能需要询问他们对API的支持,以测试PDF是否受密码保护,并解释他们的对象无法工作的原因。Chilkat.Crypt2 loCryptoTest;html文件我有html文件,如果它的密码受保护,我怎么会知道在C#我还是不明白对不起。我认为没有密码保护的HTML文件——至少HTML中没有内置的标准,除非它是真正的XHTML,并且您使用的是一种XML加密格式您的代码示例显示
.EndsWith(“.pdf”)
,这让我很困惑。除非您的意思是,您正在通过HTTP从一个网页上读取源代码,而该网页会给您一个授权错误作为响应?这种读取是在Chilkat代码中发生的吗?听起来你还是需要和他们谈谈。没关系,非常感谢你抽出时间回复我,我会同意你的建议,我会和chilkat的支持团队谈谈