Net Encryption Library
HashFileHex(HashProvider,String,String) Method
Example 






KellermanSoftware.NetEncryptionLibrary Namespace > Encryption Class > HashFileHex Method : HashFileHex(HashProvider,String,String) Method
Type of the hash.
The input file path.
The key.
Hashes the file and returns the result in hexadecimal.
Syntax
'Declaration
 
Public Overloads Function HashFileHex( _
   ByVal hashType As HashProvider, _
   ByVal inputFilePath As System.String, _
   ByVal key As System.String _
) As System.String
'Usage
 
Dim instance As Encryption
Dim hashType As HashProvider
Dim inputFilePath As System.String
Dim key As System.String
Dim value As System.String
 
value = instance.HashFileHex(hashType, inputFilePath, key)
public System.string HashFileHex( 
   HashProvider hashType,
   System.string inputFilePath,
   System.string key
)
public function HashFileHex( 
    hashType: HashProvider;
    inputFilePath: System.String;
    key: System.String
): System.String; 
public function HashFileHex( 
   hashType : HashProvider,
   inputFilePath : System.String,
   key : System.String
) : System.String;
public: System.string* HashFileHex( 
   HashProvider hashType,
   System.string* inputFilePath,
   System.string* key
) 
public:
System.String^ HashFileHex( 
   HashProvider hashType,
   System.String^ inputFilePath,
   System.String^ key
) 

Parameters

hashType
Type of the hash.
inputFilePath
The input file path.
key
The key.

Return Value

Hexadecimal encoded hash
Example
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
File.WriteAllText("test.txt", "This is a test");
 
string results = encryption.HashFileHex(HashProvider.SHA512, "test.txt", "secret");
Console.WriteLine(results);
Dim encryption As New Encryption() 'Trial Mode
'Dim encryption As New Encryption("place user name here", "place license key here") 'License Mode
 
File.WriteAllText("test.txt", "This is a test")
 
Dim results As String = encryption.HashFileHex(HashProvider.SHA512, "test.txt", "secret")
Console.WriteLine(results)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Encryption Class
Encryption Members
Overload List