38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Runtime.InteropServices;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace ConsoleApplication1
|
|
{
|
|
public class Program
|
|
{
|
|
[DllImport("C:/T32/demo/api/capi/dll/t32api64.dll")]
|
|
public static extern int T32_Config([MarshalAs(UnmanagedType.LPStr)] String String1, [MarshalAs(UnmanagedType.LPStr)] String String2);
|
|
|
|
[DllImport("C:/T32/demo/api/capi/dll/t32api64.dll")]
|
|
public static extern int T32_Init();
|
|
|
|
[DllImport("C:/T32/demo/api/capi/dll/t32api64.dll")]
|
|
public static extern int T32_Attach(int DeviceSpecifier);
|
|
|
|
[DllImport("C:/T32/demo/api/capi/dll/t32api64.dll")]
|
|
public static extern int T32_Cmd([MarshalAs(UnmanagedType.LPStr)] string Command);
|
|
|
|
[DllImport("C:/T32/demo/api/capi/dll/t32api64.dll")]
|
|
public static extern int T32_Exit();
|
|
|
|
static void Main(string[] args)
|
|
{
|
|
T32_Config("NODE=", "localhost");
|
|
T32_Config("PORT=", "20000");
|
|
T32_Config("PACKLEN=", "1024");
|
|
T32_Init();
|
|
T32_Attach(1);
|
|
T32_Cmd("PRINT \"successful connection\"");
|
|
T32_Exit();
|
|
}
|
|
}
|
|
}
|