The equivalent of the "Hello world" program for CryptoSys API is to call the
API_Version
function or General.Version
method.
If this works, it demonstrates that the API is properly installed.
Here is some example source code in VB6, C, C#, VB.NET and ASP, respectively.
Public Sub ShowVersion()
Dim nRet As Long
nRet = API_Version()
Debug.Print "Version=" & nRet
End Sub
#include <stdio.h>
#include "diCryptoSys.h"
int main(void)
{
long version;
version = API_Version();
printf("Version=%ld\n", version);
return 0;
}
#include <iostream> #include "crsysapi.hpp" int main() { std::cout << "Gen::Version=" << crsysapi::Gen::Version() << std::endl; }
using System;
using CryptoSysAPI;
class Program {
static void Main() {
int n = General.Version();
Console.WriteLine("Version = {0}", n);
}
}
Imports CryptoSysAPI
Module Module1
Sub Main()
Dim n As Integer
n = General.Version()
Console.WriteLine("Version = {0}", n)
End Sub
End Module
<%
Dim oGen
Set oGen = Server.CreateObject("diCryptOCX.gen")
Response.Write "Version=" & oGen.Version & Chr(13) & Chr(10)
%>