Windows Smartphone 嵌入map html 页面

前言:开发架构          BS       &      CS ;实现地图导航功能。

BS:Spring+hibernate、Java、JDK1.7      (设想环境)

CS:webservice、C#、.Net framwork 3.5&Windows mobile 6.0 SDK

1、创建“智能设备项目”。


2、使用“webBrowser”空间创建框架内置浏览器。

引入COM下面 windows web程序支持包,在窗体源码中编写如下代码:

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MapSmart
{
    [System.Runtime.InteropServices.ComVisibleAttribute(true)]    
    public partial class FrmMap : Form
    {
        public FrmMap()
        {
            InitializeComponent();
        }

        private void FrmMap_Load(object sender, EventArgs e)
        {
            // JSP中 调用window方法
            // οnclick="window.external.functionname()";

            //为HTML文件传递JS参数
            //object oSum = wb.Document.InvokeScript("sayHello", new object[] { 1, 2 });

            string url = "http://map.baidu.com/";
            Uri uri = new Uri(url);
            this.wb.Navigate(uri, "");

        }
    }
}
引入webbrowser所需要的库:


3、启动调试查看结果(引入html地址后)效果图。

4、参数传递

1、REST风格URL传递参数。

2、脚本方法调用参数传递:如2中代码注释处。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值