コード例 #1
0
        protected override void OnStart(string[] args)
        {
            var version_strings = Assembly.GetExecutingAssembly().GetName().Version.ToString().Split('.');
            var version_string  = "DeviceServer v" + version_strings[0] + "." + version_strings[1] + " Prerelease " + version_strings[2] + "." + version_strings[3];

            logger.AppendLog(DateTime.Now, version_string);
            logger.AppendLog(DateTime.Now, "Service - Starting");

            DeviceConnectionManager.Start();
            ServerAdvertiser.Start();
            ServerListener.Start();

            logger.AppendLog(DateTime.Now, "Service - Started");
        }
コード例 #2
0
        public DeviceServer()
        {
            InitializeComponent();

            var version_strings = Assembly.GetExecutingAssembly().GetName().Version.ToString().Split('.');
            var version_string  = "DeviceServer v" + version_strings[0] + "." + version_strings[1] + " Prerelease " + version_strings[2] + "." + version_strings[3];

            logger.AppendLog(DateTime.Now, version_string);
            logger.AppendLog(DateTime.Now, "Service - Starting");

            DeviceConnectionManager.Start();
            ServerAdvertiser.Start();
            ServerListener.Start();

            logger.AppendLog(DateTime.Now, "Service - Started");
        }