windows mobile 信号检测
2010-06-03 22:55:00 来源:WEB开发网054 UpdateConnectionState();
055 }
056
057 public void UpdateConnectionState()
058 {
059 // Set the check boxes based on the current state of the networks
060 activesync.Checked = Convert.ToBoolean(SystemState.GetValue(SystemProperty.CradlePresent));
061 gprs.Checked = Convert.ToBoolean(SystemState.GetValue(SystemProperty.PhoneGprsCoverage));
062 wifi.Checked = Convert.ToBoolean(SystemState.GetValue(SystemProperty.ConnectionsNetworkCount));
063 }
064
065
066 private void btnSync_Click(object sender, EventArgs e)
067 {
068 Sync();
069 }
070
071 private void Sync()
072 {
073
074 // Sync
075 MessageBox.Show("A synchornization would now be executed");
076
077 //////////////////////////////////////////////////////////
078 // //
079 // Insert Sync Code Here //
080 // //
081 //////////////////////////////////////////////////////////
082
083 txtStatus.Text = "Synchronization complete.";
084 }
085
086 private void button2_Click(object sender, EventArgs e)
087 {
088 Application.Exit();
089 }
090
091 public void SyncTimerEvent(object unused, EventArgs notused)
092 {
093 Sync();
094 }
095
096 private void chkTimer_CheckStateChanged(object sender, EventArgs e)
097 {
098 this.SyncTimer = new Timer();
099 this.SyncTimer.Interval = 5000;
100 this.SyncTimer.Enabled = false;
101 this.SyncTimer.Tick += new EventHandler(SyncTimerEvent);
102 if (chkTimer.Checked)
103 this.SyncTimer.Enabled = true;
104 else
105 this.SyncTimer.Enabled = false;
106
107
108 }
109
110 }
111}
更多精彩
赞助商链接