亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? servermain.cs

?? about sms how to send a sms to the mobile
?? CS
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

using GsmComm.GsmCommunication;
using GsmComm.PduConverter;


using System.Threading;

namespace SMS
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		
		private System.Windows.Forms.MainMenu mainMenu1;
		private System.Windows.Forms.MenuItem menuItem1;
		private System.Windows.Forms.Label lbl_phone_status;
		private System.Windows.Forms.TextBox txtOutput;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.MenuItem mnu_send;
		private System.Windows.Forms.MenuItem mnu_read;
	
		private delegate void SetTextCallback(string text);
		private CommSetting comm_settings=new CommSetting();
		private System.Windows.Forms.MenuItem mnudelete;


		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Form1()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.mainMenu1 = new System.Windows.Forms.MainMenu();
			this.menuItem1 = new System.Windows.Forms.MenuItem();
			this.mnu_send = new System.Windows.Forms.MenuItem();
			this.mnu_read = new System.Windows.Forms.MenuItem();
			this.lbl_phone_status = new System.Windows.Forms.Label();
			this.txtOutput = new System.Windows.Forms.TextBox();
			this.label1 = new System.Windows.Forms.Label();
			this.mnudelete = new System.Windows.Forms.MenuItem();
			this.SuspendLayout();
			// 
			// mainMenu1
			// 
			this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					  this.menuItem1});
			// 
			// menuItem1
			// 
			this.menuItem1.Index = 0;
			this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					  this.mnu_send,
																					  this.mnu_read,
																					  this.mnudelete});
			this.menuItem1.Text = "Message";
			// 
			// mnu_send
			// 
			this.mnu_send.Index = 0;
			this.mnu_send.Text = "Send";
			this.mnu_send.Click += new System.EventHandler(this.mnu_send_click);
			// 
			// mnu_read
			// 
			this.mnu_read.Index = 1;
			this.mnu_read.Text = "Read";
			this.mnu_read.Click += new System.EventHandler(this.mnu_read_click);
			// 
			// lbl_phone_status
			// 
			this.lbl_phone_status.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.lbl_phone_status.BackColor = System.Drawing.Color.White;
			this.lbl_phone_status.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.lbl_phone_status.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.lbl_phone_status.ForeColor = System.Drawing.Color.Red;
			this.lbl_phone_status.Location = new System.Drawing.Point(360, 368);
			this.lbl_phone_status.Name = "lbl_phone_status";
			this.lbl_phone_status.Size = new System.Drawing.Size(196, 23);
			this.lbl_phone_status.TabIndex = 54;
			this.lbl_phone_status.Text = "NO PHONE CONNECTED";
			this.lbl_phone_status.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			this.lbl_phone_status.UseMnemonic = false;
			// 
			// txtOutput
			// 
			this.txtOutput.Enabled = false;
			this.txtOutput.Location = new System.Drawing.Point(88, 72);
			this.txtOutput.Multiline = true;
			this.txtOutput.Name = "txtOutput";
			this.txtOutput.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
			this.txtOutput.Size = new System.Drawing.Size(472, 272);
			this.txtOutput.TabIndex = 55;
			this.txtOutput.Text = "";
			// 
			// label1
			// 
			this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.label1.Location = new System.Drawing.Point(88, 40);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(104, 24);
			this.label1.TabIndex = 56;
			this.label1.Text = "Received SMS :";
			// 
			// mnudelete
			// 
			this.mnudelete.Index = 2;
			this.mnudelete.Text = "Delete";
			this.mnudelete.Click += new System.EventHandler(this.mnudelete_Click);
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(656, 417);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.txtOutput);
			this.Controls.Add(this.lbl_phone_status);
			this.Menu = this.mainMenu1;
			this.Name = "Form1";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "SMS Server";
			this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing);
			this.Load += new System.EventHandler(this.Form1_Load);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());
		}

	
		private void Form1_Load(object sender, System.EventArgs e)
		{
			// Prompt user for connection settings
			int port = GsmCommMain.DefaultPortNumber;
			int baudRate = 9600; // We Set 9600 as our Default Baud Rate
			int timeout = GsmCommMain.DefaultTimeout;

			frmConnection dlg = new frmConnection();
			dlg.StartPosition = FormStartPosition.CenterScreen;
			dlg.SetData(port, baudRate, timeout);
			
			if (dlg.ShowDialog(this) == DialogResult.OK)
			{
				dlg.GetData(out port, out baudRate, out timeout);
				CommSetting.Comm_Port=port;
				CommSetting.Comm_BaudRate=baudRate;
				CommSetting.Comm_TimeOut=timeout;
			}
			else
			{
				Close();
				return;
			}

			Cursor.Current = Cursors.WaitCursor;
			CommSetting.comm = new GsmCommMain(port, baudRate, timeout);
			Cursor.Current = Cursors.Default;
			CommSetting.comm.PhoneConnected += new EventHandler(comm_PhoneConnected);
			CommSetting.comm.MessageReceived+=new MessageReceivedEventHandler(comm_MessageReceived);

			bool retry;
			do
			{
				retry = false;
				try
				{
					Cursor.Current = Cursors.WaitCursor;
					CommSetting.comm.Open();
					Cursor.Current = Cursors.Default;
				}
				catch(Exception)
				{
					Cursor.Current = Cursors.Default;
					if (MessageBox.Show(this, "Unable to open the port.", "Error",
						MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning) == DialogResult.Retry)
						retry = true;
					else
					{
						Close();
						return;
					}
				}
			}
			while(retry);

		}


		private delegate void ConnectedHandler(bool connected);
				
		private void OnPhoneConnectionChange(bool connected)
		{
			lbl_phone_status.Text="CONNECTED";
		}

		
		private void comm_MessageReceived(object sender, GsmComm.GsmCommunication.MessageReceivedEventArgs e)
		{
			MessageReceived();
		}

		private void comm_PhoneConnected(object sender, EventArgs e)
		{
			this.Invoke(new ConnectedHandler(OnPhoneConnectionChange), new object[] { true });
		}


		private string GetMessageStorage()
		{
			string storage = string.Empty;
			storage = PhoneStorageType.Sim;
			
			if (storage.Length == 0)
				throw new ApplicationException("Unknown message storage.");
			else
				return storage;
		}


		private void MessageReceived()
		{
			Cursor.Current = Cursors.WaitCursor;
			string storage = GetMessageStorage();

			DecodedShortMessage[] messages = CommSetting.comm.ReadMessages(PhoneMessageStatus.ReceivedUnread, storage);
			foreach(DecodedShortMessage message in messages)
			{
				Output(string.Format("Message status = {0}, Location = {1}/{2}",
					StatusToString(message.Status),	message.Storage, message.Index));
				ShowMessage(message.Data);
				Output("");
			}
			
			Output(string.Format("{0,9} messages read.", messages.Length.ToString()));
			Output("");
		}


		private string StatusToString(PhoneMessageStatus status)
		{
			// Map a message status to a string
			string ret;
			switch(status)
			{
				case PhoneMessageStatus.All:
					ret = "All";
					break;
				case PhoneMessageStatus.ReceivedRead:
					ret = "Read";
					break;
				case PhoneMessageStatus.ReceivedUnread:
					ret = "Unread";
					break;
				case PhoneMessageStatus.StoredSent:
					ret = "Sent";
					break;
				case PhoneMessageStatus.StoredUnsent:
					ret = "Unsent";
					break;
				default:
					ret = "Unknown (" + status.ToString() + ")";
					break;
			}
			return ret;
		}


        private void Output(string text)
		{
			if (this.txtOutput.InvokeRequired)
			{
				SetTextCallback stc = new SetTextCallback(Output);
				this.Invoke(stc, new object[] { text });
			}
			else
			{
				txtOutput.AppendText(text);
				txtOutput.AppendText("\r\n");
			}
		}


		private void ShowMessage(SmsPdu pdu)
		{
			if (pdu is SmsSubmitPdu)
			{
				// Stored (sent/unsent) message
				SmsSubmitPdu data = (SmsSubmitPdu)pdu;
				Output("SENT/UNSENT MESSAGE");
				Output("Recipient: " + data.DestinationAddress);
				Output("Message text: " + data.UserDataText);
				Output("-------------------------------------------------------------------");
				return;
			}
			if (pdu is SmsDeliverPdu)
			{
				// Received message
				SmsDeliverPdu data = (SmsDeliverPdu)pdu;
				Output("RECEIVED MESSAGE");
				Output("Sender: " + data.OriginatingAddress);
				Output("Sent: " + data.SCTimestamp.ToString());
				Output("Message text: " + data.UserDataText);
				Output("-------------------------------------------------------------------");
				return;
			}
			if (pdu is SmsStatusReportPdu)
			{
				// Status report
				SmsStatusReportPdu data = (SmsStatusReportPdu)pdu;
				Output("STATUS REPORT");
				Output("Recipient: " + data.RecipientAddress);
				Output("Status: " + data.Status.ToString());
				Output("Timestamp: " + data.DischargeTime.ToString());
				Output("Message ref: " + data.MessageReference.ToString());
				Output("-------------------------------------------------------------------");
				return;
			}
			Output("Unknown message type: " + pdu.GetType().ToString());
		}

		private void mnu_send_click(object sender, System.EventArgs e)
		{
			Send send_sms=new Send();
			send_sms.Show();
		}


		private void mnu_read_click(object sender, System.EventArgs e)
		{
			Receive receice_sms=new Receive();
			receice_sms.Show();
		}


		private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
			// Clean up comm object
			if (CommSetting.comm != null)
			{
				// Unregister events
				CommSetting.comm.PhoneConnected -= new EventHandler(comm_PhoneConnected);
				CommSetting.comm.MessageReceived -= new MessageReceivedEventHandler(comm_MessageReceived);
				
				// Close connection to phone
				if (CommSetting.comm != null && CommSetting.comm.IsOpen())
					CommSetting.comm.Close();

				CommSetting.comm = null;
			}
		}

		private void mnudelete_Click(object sender, System.EventArgs e)
		{
			Delete delete=new Delete();
			delete.Show();
		}
	
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人伊人久久综合网| 欧美亚洲动漫精品| 日韩免费高清av| 久久99久久久久| 日韩视频在线你懂得| 久久av资源站| 欧美韩国日本不卡| 色婷婷综合久久久久中文一区二区| 亚洲综合在线免费观看| 6080国产精品一区二区| 精品一区在线看| 欧美性生活影院| 毛片一区二区三区| 国产精品国产三级国产aⅴ无密码| 91亚洲永久精品| 日韩不卡免费视频| 中文字幕国产一区| 欧美图区在线视频| 九九视频精品免费| 亚洲色图制服丝袜| 777午夜精品免费视频| 国产99久久久久| 亚洲一区二区黄色| 久久综合九色综合97婷婷| 99九九99九九九视频精品| 日韩主播视频在线| 国产精品色呦呦| 欧美日本视频在线| 成人国产视频在线观看| 日韩精彩视频在线观看| 中文字幕一区二区三中文字幕| 欧美男生操女生| 北条麻妃一区二区三区| 美腿丝袜亚洲三区| 亚洲精品日韩一| 久久综合九色综合97婷婷女人| 色8久久精品久久久久久蜜| 久久99精品国产91久久来源 | 7777精品伊人久久久大香线蕉经典版下载 | 6080yy午夜一二三区久久| 粉嫩在线一区二区三区视频| 午夜精彩视频在线观看不卡| 国产欧美一区二区精品忘忧草| 欧美日韩综合色| 成人在线视频首页| 久久99久久99精品免视看婷婷| 亚洲精品视频自拍| 国产欧美日韩视频在线观看| 91精品国产全国免费观看| 97精品视频在线观看自产线路二| 久久69国产一区二区蜜臀| 亚洲一区二区三区四区在线免费观看 | 成人午夜免费av| 日本中文在线一区| 亚洲成国产人片在线观看| 亚洲婷婷综合久久一本伊一区| 精品国内片67194| 91.com视频| 欧美最猛性xxxxx直播| 不卡视频在线看| 国产精品99久久久| 麻豆传媒一区二区三区| 亚洲gay无套男同| 一区二区三区电影在线播| 中文字幕av一区二区三区免费看 | 一本久道久久综合中文字幕| 国产91精品在线观看| 九九国产精品视频| 日韩1区2区3区| 亚洲123区在线观看| 夜夜嗨av一区二区三区| 亚洲男人天堂av网| 亚洲欧美视频一区| 亚洲欧美色综合| 亚洲精品免费视频| 一区二区三区四区精品在线视频| 自拍偷在线精品自拍偷无码专区| 国产精品欧美极品| 国产精品久久久久久户外露出 | 亚洲欧美视频一区| 亚洲欧美韩国综合色| 亚洲自拍欧美精品| 图片区小说区区亚洲影院| 视频一区视频二区在线观看| 性欧美大战久久久久久久久| 日韩精品欧美精品| 蜜臀av性久久久久蜜臀aⅴ四虎 | 亚洲欧美另类图片小说| 伊人性伊人情综合网| 亚洲国产色一区| 亚洲r级在线视频| 蜜桃在线一区二区三区| 久久精品免费看| 国产乱码字幕精品高清av| 成人不卡免费av| 日本黄色一区二区| 91精品国产全国免费观看| 欧美不卡一二三| 中文字幕在线观看不卡| 亚洲主播在线观看| 九九**精品视频免费播放| 成人av中文字幕| 在线亚洲欧美专区二区| 91精品国产综合久久久蜜臀图片| 精品福利一区二区三区免费视频| 国产欧美视频一区二区三区| 亚洲欧美日韩成人高清在线一区| 日韩精品亚洲专区| 国产酒店精品激情| 欧美亚洲一区二区在线| 日韩精品资源二区在线| 国产精品久久久久精k8| 日韩综合小视频| 波多野结衣一区二区三区 | 9l国产精品久久久久麻豆| 欧美性受xxxx黑人xyx| 久久免费国产精品| 亚洲激情六月丁香| 精品中文字幕一区二区| 一本到高清视频免费精品| 日韩欧美成人午夜| 亚洲色图在线看| 精品无人区卡一卡二卡三乱码免费卡 | 日韩精品在线一区二区| 亚洲色图.com| 久久99精品国产.久久久久久| 色综合久久88色综合天天6| 欧美大尺度电影在线| 亚洲精品高清视频在线观看| 国产在线精品一区二区不卡了| 一本到三区不卡视频| 久久久久国产精品麻豆| 视频一区二区三区入口| 91小视频在线免费看| 精品粉嫩aⅴ一区二区三区四区| 亚洲综合无码一区二区| 成人激情电影免费在线观看| 日韩欧美一区二区免费| 亚洲国产精品一区二区尤物区| 国产精品一区二区久激情瑜伽 | 中文字幕 久热精品 视频在线| 日本视频免费一区| 91啦中文在线观看| 国产精品天天看| 九九九久久久精品| 欧美一区二区成人| 亚洲国产一区二区a毛片| 成人激情午夜影院| 国产三级久久久| 激情都市一区二区| 4438成人网| 天天免费综合色| 91激情五月电影| 亚洲欧美日韩中文字幕一区二区三区| 福利一区福利二区| 久久精品视频在线看| 青青青伊人色综合久久| 欧美日韩综合在线| 亚洲在线视频一区| 91国内精品野花午夜精品| 国产精品久久久久一区| 成人av网址在线| 国产欧美日韩不卡| 国产福利一区二区| 久久久三级国产网站| 国产精品亚洲人在线观看| 日韩精品专区在线影院重磅| 美国三级日本三级久久99| 欧美一区二区三区电影| 久久av老司机精品网站导航| 欧美大肚乱孕交hd孕妇| 另类专区欧美蜜桃臀第一页| 日韩欧美亚洲一区二区| 九九热在线视频观看这里只有精品| 日韩视频在线你懂得| 国产麻豆视频一区| 久久精品人人做人人综合| 粉嫩高潮美女一区二区三区| 国产精品视频麻豆| 一本久久精品一区二区| 亚洲成av人影院| 日韩欧美国产精品一区| 国内精品久久久久影院色| 精品成人a区在线观看| 国产美女精品在线| 国产精品福利av| 在线观看一区二区视频| 亚洲成年人网站在线观看| 日韩午夜激情免费电影| 国产九色精品成人porny | 日韩精品中文字幕在线一区| 韩国毛片一区二区三区| 国产精品麻豆视频| 一本高清dvd不卡在线观看| 日韩和欧美一区二区| 久久亚区不卡日本| 99精品热视频| 天堂久久久久va久久久久| 欧美精品一区二区三区很污很色的 | 欧美日韩精品欧美日韩精品|