CryptoSys Home > API > Creating a C# command-line app with CryptoSys API

Creating a C# command-line app with CryptoSys API


Here is a quick guide to creating a C# command-line application using Microsoft Visual Studio. This is for VS 2013.

  1. Create a new C# console project:    File > New > Project > Visual C# > Windows Desktop > Console Application
  2. Add a reference to the CryptoSys API .NET library file diCrSysAPINet.dll:    Project > Add Reference > Browse and search for
    C:\Program Files (x86)\CryptoSys\DotNet\diCrSysAPINet.dll
    The installation program should copy the .NET library DLL file into the directory C:\Program Files (x86)\CryptoSys\DotNet. Yes, that's "x86" even on a 64-bit platform. If you are using a 32-bit machine, then it will be in C:\Program Files\CryptoSys\DotNet.
  3. Make sure the Solution Platform is set to Any CPU. If not you may get a Exception from HRESULT:0x8007000B error.
  4. Add a using directive for the CryptoSysAPI library. We find the following directives are sufficient:
    using System;
    using System.Text;
    using System.Diagnostics;
    using CryptoSysAPI;
    
  5. Add your C# code module. Print out debugging messages using Console.Writeline().
  6. To check you have installed CryptoSys API properly, add this line to your program:
    static void Main(string[] args) {
    	Console.WriteLine("API Version={0}", General.Version());
    }
    
    This should output API Version=50200, or similar, depending on the actual version you have. If it fails with Unable to load DLL 'diCryptoSys.dll', you need to install it properly.

See the manual page Using with .NET for more documentation.

Contact

For more information, please send us a message.

This page last updated 15 August 2025

[Go to top]