• 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";
            }
        }

  • 相关阅读:
    python画图axis和axes以及subplot的区别
    LSTM block和cell区别
    go语言之用户输入&类型别名&类型转换
    Go 语言运算符
    go语言的常量
    go语言之数据类型和格式化输出
    go语言之变量
    requests+django+bs4实现一个web微信的功能
    python读取es中的所有数据并计算md5然后进行持久化
    python的os模块fnmatch模块介绍
  • 原文地址:https://www.cnblogs.com/eebb/p/1161694.html
Copyright © 2020-2023  润新知