Home > Net >  C # NPOI operation doc document, if you change the password?
C # NPOI operation doc document, if you change the password?

Time:10-02

If set doc document change passwords, to achieve the following effects: can open, but to changes in the word must enter the password

CodePudding user response:

After NPOI generated to save to the physical disk, and then
Using (OfficeCryptoStream ss=OfficeCryptoStream. Open (the string. Format (" d: \ \ Web \ \ \ \ XXX Report \ \ {0} ", file)))
{
Ss. Password="12345";
Ss. The Save ();
}

CodePudding user response:

Spire. Doc is the charge, is there a cracked version?

CodePudding user response:

refer to the second floor asq985 response:
NPOI formation, to save the physical disk, and then
Using (OfficeCryptoStream ss=OfficeCryptoStream. Open (the string. Format (" d: \ \ Web \ \ \ \ XXX Report \ \ {0} ", file)))
{
Ss. Password="12345";
Ss. The Save ();
}

It is required to provide the password to open, can set no password (also not prompted for a password) can open, but after opening in limited editing "protection" of the state, to stop the protection, pop-up input password dialog box, enter the correct password, to stop the protection,

CodePudding user response:

refer to the second floor asq985 response:
NPOI formation, to save the physical disk, and then
Using (OfficeCryptoStream ss=OfficeCryptoStream. Open (the string. Format (" d: \ \ Web \ \ \ \ XXX Report \ \ {0} ", file)))
{
Ss. Password="12345";
Ss. The Save ();
}

OfficeCryptoStream which DLL?
  •  Tags:  
  • C#
  • Related