static void Main(string[] args) { if (args.Length != 2) { Console.WriteLine("Parameter error\n1:Test type:1-3\n2:COMPort number"); Console.WriteLine("ex. SampleApp.exe 1 COM10"); Console.ReadKey(); return; } // Get SDK version CMMISDK_Version version = new CMMISDK_Version(); CMMISDK_API.CMMISDK_GetSDKVersion(ref version); Console.WriteLine("SDK Version: {0:0}.{1:00}.{2:0000}", version.major, version.minor, version.free); switch (args[0]) { case "1": // Perform measurement PerformMeasurement(args[1]); break; case "2": // Read sample data ReadSampleData(args[1]); break; case "3": // Write target data WriteTargetData(args[1]); break; } Console.ReadKey(); }