using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace LYFZ.WeixinServers.WeiXinAPP { public partial class SetNetIPInterface : System.Web.UI.Page { LYFZ.WeixinServiceDate.DAL.DAL_SystemConfigure scDal = new WeixinServiceDate.DAL.DAL_SystemConfigure(); public string NetIPUrl = ""; protected void Page_Load(object sender, EventArgs e) { CommonHandler.CheckLoginJump(this); LYFZ.WeixinServiceDate.Model.Model_SystemConfigure scModel = scDal.GetModel("NetIPUrl"); if (!IsPostBack) { try { if (Request.QueryString["ipurl"] != null) { if (CommonHandler.CheckAdmin(this)) { string ipurl = Request.QueryString["ipurl"].ToString().Trim(); bool retBl = false; if (scModel != null && scModel.ID > 0) { scModel.Sconfig_Value = ipurl; scModel.Sconfig_CreateName = CommonHandler.GetAdminUser(this).Account; retBl = scDal.Update(scModel); } else { scModel = new WeixinServiceDate.Model.Model_SystemConfigure(); scModel.Sconfig_Code = "NetIPUrl"; scModel.Sconfig_Value = ipurl; scModel.Sconfig_Name = "查询公网IP接口地址"; scModel.Sconfig_IsEnabled = true; scModel.Sconfig_CreateName = CommonHandler.GetAdminUser(this).Account; scModel.Sconfig_CreateDatetime = DateTime.Now; retBl = scDal.Add(scModel); } if (retBl) { Global.NetIPUrl = ipurl; myMsegesBox("保存成功!"); } else { myMsegesBox("保存失败,请重新"); } } } } catch (Exception ex){ myMsegesBox("保存失败,原因:"+ex.Message); } } if (scModel != null) { NetIPUrl = scModel.Sconfig_Value; } } void myMsegesBox(string msg) { Response.Write(""); return; } } }