首 页 | 新 闻 | Symbian | Android| Windows Mobile | J2ME | 下载中心 | 游戏策划招聘与求职 | 购书指南 | 视频教程
您现在的位置: 开发视界 >> Windows Mobile >> Windows Mobile联网 >> 正文
基于Windows Mobile 5.0的GPS应用程序开发
作者:wang8712    文章来源:csdn blog    更新时间:2007-9-25 10:55:14
            get { return dblLongitude; }
        }

  

     以上提到这些只是为可能会和我有同样需求的初学的网友提个醒,免得走弯路.

1.        附参考源代码:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using Microsoft.WindowsMobile.Samples.Location;

 

namespace TestGPS

{

    public partial class Form1 : Form

    {  

        //GPS设备状态对象

        GpsDeviceState device = null;

        //GPS位置对象

        GpsPosition position = null;

        //GPS对象

        Gps gps = new Gps();

 

       public Form1()

        {

            InitializeComponent();

        }

 

        private void Form1_Load(object sender, EventArgs e)

        {

            gps.DeviceStateChanged += new DeviceStateChangedEventHandler(gps_DeviceStateChanged);

            gps.LocationChanged += new LocationChangedEventHandler(gps_LocationChanged);

 

        }

        //位置改变时更新坐标数据

        protected void gps_LocationChanged(object sender, LocationChangedEventArgs args)

        {

            position = args.Position;

        }

        //gps设备状态改变时更新设备的状态

        void gps_DeviceStateChanged(object sender, DeviceStateChangedEventArgs args)

        {

            device = args.DeviceState;

        }

 

        //菜单:打开GPS设备

        private void open_gps_Click(object sender, EventArgs e)

        {

            if (!gps.Opened)

            {

                gps.Open();

上一页  [1] [2] [3] [4] [5] [6] 下一页

相关文章:
没有相关文章
 

站点地图 | 加入收藏 | 联系站长 | 广告服务 |
QQ:280529124  Tel:0592-8271361 辽ICP备05021703号