"Hello world" programs

The equivalent of the "Hello world" program for CryptoSys API is to call the API_Version function. The function will demonstrate that the API library is properly installed. Here is some example source code in VB6, C, C#, VB.NET/VB2005 and ASP, respectively.

VB6

Public Sub ShowVersion()
   Dim nRet As Long
   nRet = API_Version()
   Debug.Print "Version=" & nRet
End Sub

C/C++

#include <stdio.h>
#include "diCryptoSys.h"
int main(void) 
{
   long version;
   version = API_Version();
   printf("Version=%ld\n", version);
   return 0;
}

C#

using CryptoSysAPI;
static void ShowVersion()
{
   int ver;
   ver = General.Version();
   Console.WriteLine("Version={0}", ver);
}

VB.NET/VB2005

Imports CryptoSysAPI	
Shared Sub ShowVersion()
   Dim ver As Integer
   ver = General.Version()
   Console.WriteLine("Version={0}", ver)
End Sub

ASP

Dim oGen
Set oGen = Server.CreateObject("diCryptOCX.gen")
Response.Write "Version=" & oGen.Version

Contact us

To comment on this or ask questions, please contact us.

This page last updated 1 May 2007

Valid HTML 4.01! Valid CSS

Home | Blowfish | Rijndael AES | DES | Triple DES | SHA-1 | SHA-256 | Random numbers | Compression | CryptoSys Manual | Purchase | CryptoSys PKI | CryptoSys KeyExchange | Search | Cryptography Software Code | Contact us
Copyright © 2007 D.I. Management Services Pty Limited ABN 78 083 210 584, Sydney, Australia. All rights reserved.
<www.di-mgt.com.au>   <www.cryptosys.net>