Program.cs 864 Bytes
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;

namespace CardReaderService {
static class Program {
public static CardReaderService cardReader ;

/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main() {
//第一次运行 则开始监听端口并启动主程序
if(1 == Process.GetProcessesByName("lymsCardReader").Length) {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
cardReader = new CardReaderService();
Application.Run(cardReader);
} else {
Environment.Exit(0);
}
}




}


}