<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta name="generator" content="Adobe RoboHelp 2019" />
<title>Visual C# (.NET8/10)</title>
<link rel="StyleSheet" href="../../../../ms_help.css" type="text/css" />
 <script type="text/javascript" language="JavaScript">
//<![CDATA[
function reDo() {
  if (innerWidth != origWidth || innerHeight != origHeight)
     location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
	origWidth = innerWidth;
	origHeight = innerHeight;
	onresize = reDo;
}
onerror = null; 
//]]>
</script>
<style type="text/css">
<!--
div.WebHelpPopupMenu { position:absolute;
left:0px;
top:0px;
z-index:4;
visibility:hidden; }
p.WebHelpNavBar { text-align:right; }
-->
</style>

<script type="text/javascript" src="../../../../template/scripts/rh.min.js"></script>
<script type="text/javascript" src="../../../../template/scripts/common.min.js"></script>
<script type="text/javascript" src="../../../../template/scripts/topic.min.js"></script>
<script type="text/javascript" src="../../../../template/scripts/constants.js"></script>
<script type="text/javascript" src="../../../../template/scripts/utils.js"></script>
<script type="text/javascript" src="../../../../template/scripts/mhutils.js"></script>
<script type="text/javascript" src="../../../../template/scripts/mhlang.js"></script>
<script type="text/javascript" src="../../../../template/scripts/mhver.js"></script>
<script type="text/javascript" src="../../../../template/scripts/settings.js"></script>
<script type="text/javascript" src="../../../../template/scripts/XmlJsReader.js"></script>
<script type="text/javascript" src="../../../../template/scripts/loadparentdata.js"></script>
<script type="text/javascript" src="../../../../template/scripts/loadscreen.js"></script>
<script type="text/javascript" src="../../../../template/scripts/loadprojdata.js"></script>
<script type="text/javascript" src="../../../../template/scripts/mhtopic.js"></script>
 <link rel="stylesheet" type="text/css" href="../../../../template/styles/widgets.min.css">
 <link rel="stylesheet" type="text/css" href="../../../../template/styles/topic.min.css">
<script type="text/javascript" >
gRootRelPath = "../../../..";
gCommonRootRelPath = "../../../..";
gTopicId = "6.1.1.1.0_3";
</script>
 <meta name="brsprev" value="sdk/windows_api/tutorial/create/visual_basic_net_framework.htm">
 <meta name="brsnext" value="sdk/windows_api/tutorial/create/visual_c_net_framework.htm">
 <meta name="topic-breadcrumbs" content="C-LOGGER SDK > Windows API > Tutorial > Create Project" />
</head>

<body>
<script type="text/javascript" src="../../../../ehlpdhtm.js"></script>

<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P45RPFN" style="width: 0px; 
		 height: 0px; display: none; visibility: hidden;">
 <p>&#160;</p>
</iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->


<div><script type="text/javascript" language="javascript">//<![CDATA[
document.write("<p  style=\"text-align:left;\" class=\"breadcrumbs\">");
AddMasterBreadcrumbs("../../../../c_logger.htm", "breadcrumbs", " &gt; ", "Home", "../../../../welcome/c_logger.htm");
document.write("<a class=\"breadcrumbs\" href=\"../../../welcome/c_logger_sdk.htm\">C-LOGGER SDK<\/a>  &gt;  <a class=\"breadcrumbs\" href=\"../../windows_api.htm\">Windows API<\/a>  &gt;  <a class=\"breadcrumbs\" href=\"../tutorial.htm\">Tutorial<\/a>  &gt;  <a class=\"breadcrumbs\" href=\"create_project.htm\">Create Project<\/a>  &gt;  Visual C# (.NET8/10)<\/p>");
//]]></script>
</div>

<h1>Visual C# (.NET8/10)</h1>
<hr align="center" />
<p style="font-weight: bold;">Create Project</p>
<p style="margin-left: 40px;">Launch Visual Studio, select [New]-[Project/Solution] 
 from [File] menu.<br />
From the template of [Create a new project] dialog box, select [Windows 
 Forms App] of [C#], click the [Next] button.<br />
From the [Configure your new project] dialog box, specify the project name 
 and the location of the project to be created, click the [Next] button.<br />
From the [Additional information] dialog box, select [.NET 8.0(Long Term 
 Support)] / [.NET 10.0 (Long Term Support)], and click the [Create] button, then the project will be created.<br />
</p>
<p style="margin-left: 40px;">* The above is for Microsoft Visual Studio 
 Professional 2026 (64-bit). Item names and commands may differ depending 
 on the version of Visual Studio.<br />
&#160;&#160;Please refer <a href="../../faq/startup_for_visual_studio.htm">Visual 
 Studio Launch Screen</a> to know more details.</p>
<p style="margin-left: 40px;">&#160;</p>
<h2>Include Class Library</h2>
<p style="margin-left: 40px;">In order to use the functions of C-LOGGER 
 SDK in Visual C#, the class library file clogger_api.cs is required.</p>
<p style="margin-left: 40px;">Select [Project] from the menu bar of Visual 
 Studio, and select [Add Existing Item] from the pull-down menu.<br />
From the [Add Existing Item] dialog box, specify clogger_api.cs file, click 
 the [Add] button, then the class library is added to the project.</p>
<p style="margin-left: 40px;">You can check whether the registered class 
 library exists from the tree view in the [Solution Explorer] window of 
 Visual Studio.</p>
<p style="margin-left: 40px;">* The above is for Microsoft Visual Studio 
 Professional 2026 (64-bit). Item names and commands may differ depending 
 on the version of Visual Studio.</p>
<p style="margin-left: 40px;">&#160;</p>
<h2>Add Name Space</h2>
<p style="margin-left: 40px;">Add the name space to use the methods in 
 class library.<br />
At the beginning of the C# source code file (with .cs extension), please 
 add the following line.</p>
<p class="code" style="margin-left: 64px;">using clogger_api_cs;</p>
<p style="margin-left: 40px;">&#160;</p>
<h2>Create Class Instance</h2>
<p style="margin-left: 40px;">Create an instance of the class to use the 
 class library.<br />
In the C# source code file (with .cs extension), add the following lines 
 at the beginning of form class.</p>
<p class="code" style="margin-left: 64px;">public class Form1 : System.Windows.Forms.Form</p>
<p class="code" style="margin-left: 64px;">{</p>
<p class="code" style="margin-left: 104px;">clogger_api &#160;logger = 
 new clogger_api();// &lt;- add</p>
<p class="code" style="margin-left: 104px;">･･･････<br />
･･･････</p>
<p class="code" style="margin-left: 64px;">&#160;</p>
<h2>&#160;How to Use Class Library Methods</h2>
<p style="margin-left: 40px;">In C#, instead of calling C-LOGGER function 
 directly, call the class library method.<br />
C-LOGGER SDK functions are called from class library methods.</p>
<p style="margin-left: 40px;">All the methods in the class library are 
 defined with the name by omitting the prefix [Logger] of the function 
 name.<br />
When using with C#, please use the method without prefix [Logger].</p>
<p style="margin-left: 40px;">For example, when using LoggerOpenApplication 
 function</p>
<p class="code" style="margin-left: 64px;">Ret = logger.OpenApplication( 
 ・・・・</p>
<p style="margin-left: 40px;">For example, when using LoggerStartOperation 
 function</p>
<p class="code" style="margin-left: 64px;">Ret = logger.StartOperation 
 ( ・・・・</p>
<p>&#160;</p>
<p>&#160;</p>
<div style="width: 100%; position: relative;" id="footer">
	<hr style="float: aligncenter; " />
	<p>This website uses cookies. By continuing to browse our site you 
	 agree to our <a href="https://www.contec.com/privacy#anc-01">use of 
	 cookies</a>.</p>
</div>
</body>
</html>
