service.cs

来自「Easy to use SMS/MMS Messaging Gateway to」· CS 代码 · 共 68 行

CS
68
字号
/*
 * Easy Messaging Gateway (SMS/MMS/Mail) - Easy to use SMS/MMS Messaging Gateway
 * to develop Content Delivery Platforms by GSM Operators,Content Providers
 * and even non-telecom guys. 
 * 
 * Uses file system for data flow. Protocol level is based on Easy SMPP and Easy MM7 projects.
 * 
 * Written for .NET 2.0 in C# 
 * Copyright (C) 2006 Balan Andrei, http://balan.name
 * 
 * Licensed under the terms of the GNU Lesser General Public License:
 * 		http://www.gnu.org/licenses/lgpl.html
 * 
 * For further information visit:
 * 		http://easymessaging.sf.net/
 * 
 * 
 * "Support Open Source software. What about a donation today?"
 *
 * 
 * File Name: Service.cs
 * 
 * File Authors:
 * 		Balan Name, http://balan.name
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;

using EasySMPP;

namespace EasyMessaging.SmsGateway
{
    public partial class Service : ServiceBase
    {
        private SmsDispatcher smsDispatcher;
        private InboxWatcher inboxWatcher;
        public Service()
        {
            smsDispatcher = new SmsDispatcher();
            inboxWatcher = new InboxWatcher(smsDispatcher);
            InitializeComponent();
        }
        public void Start()
        {
            OnStart(new string[0]);
        }
        public new void Stop()
        {
            OnStop();
        }
        protected override void OnStart(string[] args)
        {
            smsDispatcher.Start();
            inboxWatcher.Start();
        }
        protected override void OnStop()
        {
            inboxWatcher.Stop();
            smsDispatcher.Stop();
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?