22f732ab9d
* CMS_CORE_Nc_Demo_Application (Server) * Added new Nc Demo into CMS_CORE_Library (Client)
61 lines
1.7 KiB
C#
61 lines
1.7 KiB
C#
using CMS_CORE;
|
|
using CMS_CORE.Exceptions;
|
|
using CMS_CORE.Osai;
|
|
using CMS_CORE.Demo;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.ServiceModel;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace CMS_CORE_Application
|
|
{
|
|
public partial class Form1 : Form
|
|
{
|
|
public Form1()
|
|
{
|
|
InitializeComponent();
|
|
|
|
SKGL.SerialKeyConfiguration conf = new SKGL.SerialKeyConfiguration();
|
|
conf.Features[0] = true;
|
|
SKGL.Generate gg = new SKGL.Generate(conf);
|
|
gg.secretPhase = "test";
|
|
string ss = gg.doKey(999);
|
|
|
|
|
|
SKGL.Validate vv = new SKGL.Validate(conf);
|
|
vv.secretPhase = "test";
|
|
vv.Key = ss;
|
|
Boolean tt= vv.IsValid;
|
|
|
|
Nc N = new Nc_Osai("192.168.157.2", 8080, 2);
|
|
try
|
|
{
|
|
N.Connect();
|
|
}
|
|
catch(Nc_Exception e)
|
|
{
|
|
MessageBox.Show(e.Message);
|
|
}
|
|
Nc_Demo nc_Demo = new Nc_Demo();
|
|
nc_Demo.Connect();
|
|
|
|
DateTime testDateTime = new DateTime();
|
|
nc_Demo.R_NCDateTime(ref testDateTime);
|
|
|
|
byte byteValue = 0;
|
|
nc_Demo.RW_Byte(false, 1, Nc.MEMORY_Type.NullVariable, 0, 0, ref byteValue);
|
|
MessageBox.Show("First byte:" + byteValue.ToString() + "DateTime " + testDateTime.ToString());
|
|
}
|
|
|
|
private void Form1_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
}
|
|
} |