zoukankan      html  css  js  c++  java
  • google map

        protected void Button1_Click(object sender, EventArgs e)
        {

            string sHtml = "";
            HttpWebRequest request;
            HttpWebResponse response = null;
            Stream stream;

            request = (HttpWebRequest)WebRequest.Create("http://maps.google.com/maps/geo?q=Brghghghkst+raat+336&output=xml&key=ABQIAAAAuaqmm8dDnhww8URMYtFCwhQpDmmpk8q921mRIPG4qgOvy0T09hSxaQUI-wgAo7USMOwfIrceghhDnA");
            response = (HttpWebResponse)request.GetResponse();
            stream = response.GetResponseStream();
            sHtml = new StreamReader(stream, System.Text.Encoding.Default).ReadToEnd();
            stream.Close();
            response.Close();

            int startPosition = sHtml.IndexOf("<coordinates>");
            int endPosition = sHtml.IndexOf("</coordinates>");
            if (startPosition >= 0 && endPosition >= 0)
            {
                string coordi = sHtml.Substring(startPosition, endPosition - startPosition);
                //Label2.Text = coordi;
                int douposition = coordi.LastIndexOf(",");
                coordi = coordi.Substring(0, douposition);
                Label1.Text = coordi;
            }
            else
            {
                Label1.Text = "no";
            }
        }

  • 相关阅读:
    ScrollView 实现循环轮播
    UINavigationController和UITabBarController合用
    iOS开发网络篇—网络编程基础
    iOS开发网络篇—搭建本地服务器
    iOS开发网络篇—HTTP协议
    iOS开发网络篇—GET请求和POST请求
    UIView
    iOS准备程序
    iOS小程序-混合计算器
    IOS入门-计算机小程序
  • 原文地址:https://www.cnblogs.com/eebb/p/1161694.html
Copyright © 2011-2022 走看看