SolFSStorage.CheckFilePassword method


Pascal    Plain C    C++ (DLL/Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET    Java 

SolFSStorage     See also    


Checks if the password for the file is correct.


    function CheckFilePassword( const FileName: TSolFSString; Password: TSolFSString; EncryptionUnknown: Boolean; Encryption: TSolFSEncryption=ecNoEncryption ): Boolean;
    type TSolFSString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[Plain C]
    long _stdcall StorageCheckFilePassword(unsigned long Storage, const wchar_t* FileName, unsigned long Encryption, char EncryptionUnknown, wchar_t* Password, unsigned long PasswordLen, char *Valid);

[C++ (DLL/Lib)]
    bool CheckFilePassword(unsigned short *fileName, unsigned short *password, bool encryptionUnknown, SolFSEncryption encryption);

[C++ (VCL)]
    bool __fastcall CheckFilePassword(const TSolFSString FileName, String Password, bool EncryptionUnknown, TSolFSEncryption Encryption=ecNoEncryption);

[C++ (.NET)]
    bool CheckFilePassword(String *fileName, String *password, bool encryptionUnknown, SolFSEncryption encryption);

    bool CheckFilePassword( String fileName, String password, bool encryptionUnknown, SolFSEncryption encryption);

    Function CheckFilePassword( ByVal fileName As String, ByVal password As String, ByVal encryptionUnknown As Boolean, ByVal encryption As SolFSEncryption) As Boolean

    void checkFilePassword( String fileName, String password, boolean encryptionUnknown, EncryptionTypes encryption);


  • FileName - the full file name in the SolFSStorage.
  • Password - password you want to check.
  • EncryptiomUnknown - set this parameter to True if the type of encryption used is unknown.
  • Encryption - set this parameter to encryption type if it is known.
  • [Plain C] Storage - handle to the storage returned by Create or Open function.
  • [Plain C] PasswordLen - length of the Password in bytes (not counting terminating NULL).
  • [Plain C] Valid - returns 1 if password was correct,
    0 if password was incorrect.

Return value

    True if password was correct.
    False if password was incorrect.

     [Plain C]  0 if the function succeeded or one of Error codes if the function failed.

Values of SolFSEncryption


Use this method to check the password of the file. Set EncryptionUknown to true if the type of encryption used is unknown. Set Encryption parameter to encryption type if it is known.

See also

FilesEncryption     FilesPassword     SetFileEncryption