Visual C# (.NET Framework)


Create Project

Launch Visual Studio, select [New]-[Project] from [File] menu.
From the [Templates] of [New Project] dialog box, select [Windows Form Application] of [Visual C#],
and specify the name and location of the project to be created.
When click the [OK] button, the project will be created.

* Item names and commands may differ depending on the version of Visual Studio.

 

Include Class Library

In order to use the functions of C-LOGGER SDK in Visual C#, the class library file clogger_api.cs is required.
Add the clogger_api.cs file from [Project]-[Add Existing Item].

 

Add Name Space

Add the name space to use the methods in class library.
At the beginning of the C# source code file (with .cs extension), please add the following line.

using clogger_api_cs;

 

Create Class Instance

Create an instance of the class to use the class library.
In the C# source code file (with .cs extension), add the following lines at the beginning of form class.

public class Form1 : System.Windows.Forms.Form

{

clogger_api  logger = new clogger_api();// <- add

・・・・・・・
・・・・・・・

 

 How to Use Class Library Methods

In C#, instead of calling C-LOGGER function directly, call the class library method.
C-LOGGER SDK functions are called from class library methods.

All the methods in the class library are defined with the name by omitting the prefix [Logger] of the function name.
When using with C#, please use the method without prefix [Logger].

For example, when using LoggerOpenApplication function

Ret = logger.OpenApplication( ・・・・

For example, when using LoggerStartOperation function

Ret = logger.StartOperation ( ・・・・