To use the .NET interface with C# and VB.NET (VB2010+):
diCrSysAPINet.dll
library file into a convenient folder.diCrSysAPINet.dll
.using CryptoSysAPI;
Imports CryptoSysAPI
to your code.
Alternatively, with C#, you can just include the source code module CryptoSysAPI.cs
in your project
and there is no need to reference or use the class library DLL.
Note that you must also have the core Win32 (or X64) executable diCryptoSys.dll
installed on your system
for the .NET interface to work. If not, it will throw an exception immediately:
Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'diCryptoSys.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
If you are working on a 64-bit system, Visual Studio will go looking for the 64-bit core DLL in the Windows system folder
(usually C:\Windows\System32
).
Make sure you set the Solution Platform to be Any CPU.
The .NET class library diCrSysAPINet.dll
is compiled for all platforms (Win32 and X64) and
requires at least .NET 4.0 and should be upwardly compatible with all later .NET versions.
This means that you must be using VS2010 or later.
There are two different types of methods used in the .NET interface:-
We recommend that you use the static "one-off" methods unless you really have to deal with streaming data of unknown length.
For examples, see the test code TestAPIcsharp.cs
and TestAPIvbnet.vb
provided in the distribution.
If you need to convert existing VB6 code, see Converting VB6 to VB.NET.