C#百度定位API使用

1、定义一个存储百度API返回json结果对象的类:

注:解析json字符串的方式有很多,无需局限于本文这一种。

    public class baidu_location
    {
        [Serializable]
        //存储百度定位API返回结果类
        public class AddressForQueryIPFromBaidu {
            public string Address { get; set; }
            public Content Content { get; set; }
            public string Status { get; set; }
        }
        [Serializable]
        public class Content {
            public string Address { get; set; }
            public Address_Detail Address_Detail { get; set; }
            public Point Point { get; set; }
        }
        [Serializable]
        public class Address_Detail {
            public string City { get; set; }
            public string City_Code { get; set; }
            public string District { get; set; }
            public string Province { get; set; }
            public string Street { get; set; }
            public string Street_Number { get; se
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值