搜索内容汇总

坐标拾取:http://api.map.baidu.com/lbsapi/getpoint/index.html

跳转302链接或者是地址不便,显示某文件内容

string ip = string.Empty;
        Dictionary<string, string> place = com_1633_tools.Ip.GetPlaceByIp(ip);
        string city = place["city"].TrimEnd('市');
        var model = db.GetModel<tbl_siteconfig>(m => m.city == city);
        if (model != null)
        {
            Response.Redirect("http://" + model.shortname + ".1633.test");
        }
        else
        {
            Encoding code = Encoding.GetEncoding("gb2312");
            // 读取模板文件 
            string temp = HttpContext.Current.Server.MapPath("/index.shtml");
            StreamReader sr = null;
            string str = "";
            try
            {
                sr = new StreamReader(temp, code);
                str = sr.ReadToEnd(); // 读取文件 
            }
            catch (Exception exp)
            {
                HttpContext.Current.Response.Write(exp.Message);
                HttpContext.Current.Response.End();
                sr.Close();
            }
            Response.Write(str);

  

posted on 2018-06-28 09:50  阳光秋天  阅读(240)  评论(0编辑  收藏  举报