Net Encryption Library
HashFileHex(HashProvider,String) Method
Example 






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

Parameters

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

Return Value

Hash in hexadecimal
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");
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")
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