资源简介
C#中winform开发的地图定位-Google地图定位

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.xml;
//Download by http://www.codefans.net
namespace Google
{
public partial class Form1 : Form
{
[DllImport(“user32.dll“ CharSet = CharSet.Auto SetLastError = false)]
static extern IntPtr SendMessage(IntPtr hWnd uint Msg IntPtr wParam IntPtr lParam);
[DllImport(“user32.dll“ SetLastError = true)]
static extern IntPtr GetWindow(IntPtr hWnd uint uCmd);
[DllImport(“user32.dll“ CharSet = CharSet.Auto)]
static extern int GetClassName(IntPtr hWnd StringBuilder lpClassName int nMaxCount);
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender EventArgs e)
{
this.FormBorderstyle = System.Windows.Forms.FormBorderstyle.FixedSingle;
try
{
//加载地图
string address = “File:\\“ + Application.StartupPath + “\\index.html“;
Uri url = new Uri(address);
webBrowser1.Url = url;
webBrowser1.scriptErrorsSuppressed = false;
}
catch (Exception except)
{
MessageBox.Show(except.Message “提示!“
MessageBoxButtons.OK MessageBoxIcon.Warning);
}
}
private void zoombtn1_Click(object sender EventArgs e)
{
try
{
mshtml.IHTMLDocument2 currentDoc = (mshtml.IHTMLDocument2)webBrowser1.Document.DomDocument;
mshtml.IHTMLWindow2 win = (mshtml.IHTMLWindow2)currentDoc.parentWindow;
win.execscript(“ZoomInMap()“ “javascript“);
}
catch (Exception except)
{
MessageBox.Show(except.Message “提示!“
MessageBoxButtons.OK MessageBoxIcon.Warning);
}
}
private void zoombtn2_Click(object sender EventArgs e)
{
try
{
mshtml.IHTMLDocument2 currentDoc = (mshtml.IHTMLDocument2)webBrowser1.Document.DomDocument;
mshtml.IHTMLWindow2 win = (mshtml.IHTMLWindow2)currentDoc.parentWindow;
win.execscript(“ZoomOutMap()“ “javascript“);
}
catch (Exception except)
{
MessageBox.Show(except.Message “提示!“
MessageBoxButtons.OK MessageBoxIcon.Warning);
}
}
public string StrAddress = ““;//记录用户输入的地址。
private void checkbtn_Click(object sender EventArgs e)
{
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
----------- --------- ---------- ----- ----
384742 19
- 上一篇:C# 电话客服系统(完整)
- 下一篇:C# 异或校验含源码
相关资源
- C# TIP文件生成和拆解
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- Winform可视化打印模板设计工具含源码
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
评论
共有 条评论