本文整理汇总了C#中BLL.siteconfig类的典型用法代码示例。如果您正苦于以下问题:C# BLL.siteconfig类的具体用法?C# BLL.siteconfig怎么用?C# BLL.siteconfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BLL.siteconfig类属于命名空间,在下文中一共展示了BLL.siteconfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
//读取站点配置信息
Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig();
Config xmlConfig = new Config(); //读取配置
v_oid = DTRequest.GetString("v_oid").ToUpper();
v_pstatus = DTRequest.GetString("v_pstatus");
v_pstring =DTRequest.GetString("v_pstring");
v_pmode = DTRequest.GetString("v_pmode");
v_md5str =DTRequest.GetString("v_md5str");
v_amount = DTRequest.GetString("v_amount");
v_moneytype = DTRequest.GetString("v_moneytype");
remark1 = DTRequest.GetString("remark1");
remark2 = DTRequest.GetString("remark2");
// 拼凑加密串
string signtext = v_oid + v_pstatus + v_amount + v_moneytype + xmlConfig.Key;
signtext = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(signtext, "md5").ToUpper();
if (signtext == v_md5str)
{
if (v_pstatus.Equals("20"))
{
//成功状态
Response.Redirect(new Web.UI.BasePage().linkurl("payment", "?action=succeed&order_no=" + v_oid));
return;
}
}
//失败状态
Response.Redirect(new Web.UI.BasePage().linkurl("payment", "?action=error"));
return;
}
示例2: OutPutHtml
/// <summary>
/// 输出最终的html
/// </summary>
/// <param name="templateFileName"></param>
/// <param name="tPath"></param>
/// <param name="wid"></param>
public void OutPutHtml(string templateFileName)
{
////注册一个自定义函数
//this.Document.RegisterGlobalFunction(this.GetNewsUrl);
//对VT模板里的config变量赋值
Model.siteconfig config = new BLL.siteconfig().loadConfig();
string dd = Utils.ObjectToStr(config.webkeyword);
this.Document.Variables.SetValue("config", config);
this.Document.SetValue("ccright", ccRight);
this.Document.SetValue("thisurl", MyCommFun.getTotalUrl());
this.Document.SetValue("yuming", MyCommFun.getWebSite());
string openid = MyCommFun.RequestOpenid();
this.Document.SetValue("openid", openid);
this.Document.Variables.SetValue("this", this);
if (tType == TemplateType.Class)
{ //如果为列表页面
ArticleClassPage();
}
if (tType == TemplateType.News)
{
ArticleDetailPage();
}
if (tType == TemplateType.Channel)
{
ArticleChannelPage();
}
//输出最终呈现的数据
this.Document.Render(HttpContext.Current.Response.Output);
}
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
//读取站点配置信息
Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(DTKeys.FILE_SITE_XML_CONFING);
string order_type = DTRequest.GetFormString("pay_order_type"); //订单类型
string order_no = DTRequest.GetFormString("pay_order_no");
decimal order_amount = DTRequest.GetFormDecimal("pay_order_amount", 0);
string subject = DTRequest.GetFormString("pay_subject");
if (order_no == "" || order_amount == 0 )
{
Response.Redirect(siteConfig.webpath + "error.aspx?msg=" + Utils.UrlEncode("对不起,您提交的参数有误!"));
return;
}
//检查是否已登录
Model.users userModel = new Web.UI.BasePage().GetUserInfo();
if (userModel == null)
{
Response.Redirect(new Web.UI.BasePage().linkurl("payment", "login")); //尚未登录
return;
}
if (userModel.amount < order_amount)
{
Response.Redirect(new Web.UI.BasePage().linkurl("payment", "recharge")); //账户的余额不足
return;
}
if (order_type.ToLower() == DTEnums.AmountTypeEnum.BuyGoods.ToString().ToLower()) //购买商品
{
BLL.orders bll = new BLL.orders();
Model.orders model = bll.GetModel(order_no);
if (model == null)
{
Response.Redirect(siteConfig.webpath + "error.aspx?msg=" + Utils.UrlEncode("对不起,商品订单号不存在!"));
return;
}
//执行扣取账户金额
int result = new BLL.amount_log().Add(userModel.id, userModel.user_name, DTEnums.AmountTypeEnum.BuyGoods.ToString(), order_no, model.payment_id, -1 * order_amount, subject, 1);
if (result > 0)
{
//更改订单状态
bool result1 = bll.UpdateField(order_no, "payment_status=2,payment_time='" + DateTime.Now + "'");
if (!result1)
{
Response.Redirect(new Web.UI.BasePage().linkurl("payment", "error"));
return;
}
//扣除积分
if (model.point < 0)
{
new BLL.point_log().Add(model.user_id, model.user_name, model.point, "换购扣除积分,订单号:" + model.order_no);
}
//支付成功
Response.Redirect(new Web.UI.BasePage().linkurl("payment1", "succeed", order_type, order_no));
return;
}
}
Response.Redirect(siteConfig.webpath + "error.aspx?msg=" + Utils.UrlEncode("对不起,找不到需要支付的订单类型!"));
return;
}
示例4: ReUrl_BeginRequest
/// <summary>
/// 页面请求事件处理
/// </summary>
/// <param name="sender">事件的源</param>
/// <param name="e">包含事件数据的 EventArgs</param>
private void ReUrl_BeginRequest(object sender, EventArgs e)
{
HttpContext context = ((HttpApplication)sender).Context;
string requestPath = context.Request.Path; //获得当前页面,包含目录
string requestPage = requestPath.Substring(requestPath.LastIndexOf("/")); //获得当前页面,不包含目录
Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING)); //获得站点配置信息
bool isRewritePath = IsUrlRewrite(siteConfig.webpath, requestPath); //排除不需要URL重写的目录
switch (siteConfig.staticstatus)
{
case 0:
//关闭重写
if (isRewritePath && IsAspxFile(requestPath))
{
context.RewritePath(siteConfig.webpath + DTKeys.DIRECTORY_REWRITE_ASPX + "/" + requestPage);
}
break;
case 1:
//伪URL重写
if (isRewritePath)
{
RewriteUrl(context, siteConfig.webpath, requestPath, requestPage);
}
break;
case 2:
//全静态
if (requestPath.ToLower().Equals("/index.aspx"))
{
context.RewritePath(siteConfig.webpath + DTKeys.DIRECTORY_REWRITE_HTML + "/index." + siteConfig.staticextension);
}
break;
}
}
示例5: Config
static Config()
{
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
//读取XML配置信息
string fullPath = Utils.GetMapPath("~/xmlconfig/alipay.config");
XmlDocument doc = new XmlDocument();
doc.Load(fullPath);
XmlNode _partner = doc.SelectSingleNode(@"Root/partner");
XmlNode _key = doc.SelectSingleNode(@"Root/key");
XmlNode _email = doc.SelectSingleNode(@"Root/email");
XmlNode _return_url = doc.SelectSingleNode(@"Root/return_url");
XmlNode _notify_url = doc.SelectSingleNode(@"Root/notify_url");
//读取站点配置信息
Model.siteconfig model = new BLL.siteconfig().loadConfig();
//合作身份者ID,以2088开头由16位纯数字组成的字符串
partner = _partner.InnerText;
//交易安全检验码,由数字和字母组成的32位字符串
key = _key.InnerText;
//签约支付宝账号或卖家支付宝帐户
email = _email.InnerText;
//页面跳转同步返回页面文件路径 要用 http://格式的完整路径,不允许加?id=123这类自定义参数
return_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + _return_url.InnerText;
//服务器通知的页面文件路径 要用 http://格式的完整路径,不允许加?id=123这类自定义参数
notify_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + _notify_url.InnerText;
//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
//字符编码格式 目前支持 gbk 或 utf-8
input_charset = "utf-8";
//签名方式 不需修改
sign_type = "MD5";
}
示例6: UpLoadFile
private void UpLoadFile(HttpContext context)
{
Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig();
string _delfile = DTRequest.GetString("DelFilePath");
HttpPostedFile _upfile = context.Request.Files["Filedata"];
bool _iswater = false; //默认不打水印
bool _isthumbnail = false; //默认不生成缩略图
if (DTRequest.GetQueryString("IsWater") == "1")
_iswater = true;
if (DTRequest.GetQueryString("IsThumbnail") == "1")
_isthumbnail = true;
if (_upfile == null)
{
context.Response.Write("{\"status\": 0, \"msg\": \"请选择要上传文件!\"}");
return;
}
UpLoad upFiles = new UpLoad();
string msg = upFiles.fileSaveAs(_upfile, _isthumbnail, _iswater);
//删除已存在的旧文件,旧文件不为空且应是上传文件,防止跨目录删除
if (!string.IsNullOrEmpty(_delfile) && _delfile.IndexOf("../") == -1
&& _delfile.ToLower().StartsWith(siteConfig.webpath.ToLower() + siteConfig.filepath.ToLower()))
{
Utils.DeleteUpFile(_delfile);
}
//返回成功信息
context.Response.Write(msg);
context.Response.End();
}
示例7: lbtnStart_Click
//启用模板
protected void lbtnStart_Click(object sender, EventArgs e)
{
ChkAdminLevel("sys_templet", ActionEnum.Add.ToString()); //检查权限
BLL.siteconfig bll = new BLL.siteconfig();
Model.siteconfig model = siteConfig;
for (int i = 0; i < rptList.Items.Count; i++)
{
string skinName = ((HiddenField)rptList.Items[i].FindControl("hideSkinName")).Value;
CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
if (cb.Checked)
{
//判是否当前模板
if (skinName.ToLower() == siteConfig.templateskin)
{
JscriptMsg("该模板已是当前模板啦!", "back", "Warning");
return;
}
model.templateskin = skinName.ToLower();
//修改配置文件
bll.saveConifg(model, Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
//重新生成模板
MarkTemplates(skinName);
JscriptMsg("模板启用并全部生成成功啦!", "templet_list.aspx", "Success");
return;
}
}
}
示例8: Config
static Config()
{
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
//读取XML配置信息
string fullPath = Utils.GetMapPath("~/xmlconfig/alipay.config");
XmlDocument doc = new XmlDocument();
doc.Load(fullPath);
XmlNode _partner = doc.SelectSingleNode(@"Root/partner");
XmlNode _key = doc.SelectSingleNode(@"Root/key");
XmlNode _seller_email = doc.SelectSingleNode(@"Root/seller_email");
XmlNode _return_url = doc.SelectSingleNode(@"Root/return_url");
XmlNode _notify_url = doc.SelectSingleNode(@"Root/notify_url");
//读取站点配置信息
Model.siteconfig model = new BLL.siteconfig().loadConfig(DTKeys.FILE_SITE_XML_CONFING);
//合作身份者ID,以2088开头由16位纯数字组成的字符串
partner = _partner.InnerText;
//交易安全检验码,由数字和字母组成的32位字符串
key = _key.InnerText;
//签约支付宝账号或卖家支付宝帐户
seller_email = _seller_email.InnerText;
//页面跳转同步返回页面文件路径 要用 http://格式的完整路径,不允许加?id=123这类自定义参数
return_url = Utils.DelLastChar(model.weburl, "/") + _return_url.InnerText;
//服务器通知的页面文件路径 要用 http://格式的完整路径,不允许加?id=123这类自定义参数
notify_url = Utils.DelLastChar(model.weburl, "/") + _notify_url.InnerText;
//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
//字符编码格式 目前支持 gbk 或 utf-8
input_charset = "utf-8";
//签名方式 不需修改
sign_type = "MD5";
}
示例9: comment_add
private void comment_add(HttpContext context)
{
Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
StringBuilder strTxt = new StringBuilder();
BLL.comment bll = new BLL.comment();
Model.comment model = new Model.comment();
string _code = DTRequest.GetFormString("txtCode");
int _channel_id = DTRequest.GetQueryInt("channel_id");
int _content_id = DTRequest.GetQueryInt("content_id");
string _title = DTRequest.GetFormString("txtTitle");
string _content = DTRequest.GetFormString("txtContent");
//校检验证码
if (string.IsNullOrEmpty(_code))
{
context.Response.Write("{msg:0, msgbox:\"对不起,请输入验证码!\"}");
return;
}
if (context.Session[DTKeys.SESSION_CODE] == null)
{
context.Response.Write("{msg:0, msgbox:\"对不起,系统找不到生成的验证码!\"}");
return;
}
if (_code.ToLower() != (context.Session[DTKeys.SESSION_CODE].ToString()).ToLower())
{
context.Response.Write("{msg:0, msgbox:\"您输入的验证码与系统的不一致!\"}");
return;
}
if (_channel_id == 0 || _content_id == 0)
{
context.Response.Write("{msg: 0, msgbox: \"对不起,参数传输有误!\"}");
return;
}
if (string.IsNullOrEmpty(_content))
{
context.Response.Write("{msg: 0, msgbox: \"对不起,请输入评论的内容!\"}");
return;
}
model.channel_id = _channel_id;
model.content_id = _content_id;
model.title = _title;
model.content = Utils.ToHtml(_content);
model.user_name = "游客";
model.user_ip = DTRequest.GetIP();
model.is_lock = siteConfig.commentstatus; //审核开关
model.add_time = DateTime.Now;
model.is_reply = 0;
if (bll.Add(model) > 0)
{
context.Response.Write("{msg: 1, msgbox: \"恭喜您,留言提交成功啦!\"}");
return;
}
context.Response.Write("{msg: 0, msgbox: \"对不起,保存过程中发生错误!\"}");
return;
}
示例10: ShowInfo
private void ShowInfo()
{
BLL.siteconfig bll = new BLL.siteconfig();
Model.siteconfig model = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
webname.Text = model.webname;
webcompany.Text = model.webcompany;
weburl.Text = model.weburl;
webtel.Text = model.webtel;
webfax.Text = model.webfax;
webmail.Text = model.webmail;
webcrod.Text = model.webcrod;
webtitle.Text = model.webtitle;
webkeyword.Text = model.webkeyword;
webdescription.Text = model.webdescription;
webcopyright.Text = model.webcopyright;
webpath.Text = model.webpath;
webmanagepath.Text = model.webmanagepath;
webstatus.Text = model.webstatus.ToString();
webclosereason.Text = model.webclosereason;
webcountcode.Text = model.webcountcode;
staticstatus.SelectedValue = model.staticstatus.ToString();
staticextension.Text = model.staticextension;
memberstatus.SelectedValue = model.memberstatus.ToString();
commentstatus.SelectedValue = model.commentstatus.ToString();
logstatus.SelectedValue = model.logstatus.ToString();
emailstmp.Text = model.emailstmp;
emailport.Text = model.emailport.ToString();
emailfrom.Text = model.emailfrom;
emailusername.Text = model.emailusername;
if (!string.IsNullOrEmpty(model.emailpassword))
{
emailpassword.Attributes["value"] = defaultpassword;
}
emailnickname.Text = model.emailnickname;
attachpath.Text = model.attachpath;
attachextension.Text = model.attachextension;
attachsave.SelectedValue = model.attachsave.ToString();
attachfilesize.Text = model.attachfilesize.ToString();
attachimgsize.Text = model.attachimgsize.ToString();
attachimgmaxheight.Text = model.attachimgmaxheight.ToString();
attachimgmaxwidth.Text = model.attachimgmaxwidth.ToString();
thumbnailheight.Text = model.thumbnailheight.ToString();
thumbnailwidth.Text = model.thumbnailwidth.ToString();
watermarktype.SelectedValue = model.watermarktype.ToString();
watermarkposition.Text = model.watermarkposition.ToString();
watermarkimgquality.Text = model.watermarkimgquality.ToString();
watermarkpic.Text = model.watermarkpic;
watermarktransparency.Text = model.watermarktransparency.ToString();
watermarktext.Text = model.watermarktext;
watermarkfont.Text = model.watermarkfont;
watermarkfontsize.Text = model.watermarkfontsize.ToString();
}
示例11: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
string userName = txtUserName.Text.Trim();
string userPwd = txtPassword.Text.Trim();
if (userName.Equals("") || userPwd.Equals(""))
{
msgtip.InnerHtml = "请输入用户名或密码";
return;
}
if (Session["AdminLoginSun"] == null)
{
Session["AdminLoginSun"] = 1;
}
else
{
Session["AdminLoginSun"] = Convert.ToInt32(Session["AdminLoginSun"]) + 1;
}
//判断登录错误次数
if (Session["AdminLoginSun"] != null && Convert.ToInt32(Session["AdminLoginSun"]) > 5)
{
msgtip.InnerHtml = "错误超过5次,关闭浏览器重新登录!";
return;
}
BLL.manager bll = new BLL.manager();
Model.manager model = bll.GetModel(userName, userPwd, true);
if (model == null)
{
msgtip.InnerHtml = "用户名或密码有误,请重试!";
return;
}
// 保存当前的后台管理员
Session[MXKeys.SESSION_ADMIN_INFO] = model;
Session.Timeout = 45;
//写入登录日志
Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig();
if (siteConfig.logstatus > 0)
{
new BLL.manager_log().Add(model.id, model.user_name, MXEnums.ActionEnum.Login.ToString(), "用户登录");
}
//写入Cookies
Utils.WriteCookie("DTRememberName", model.user_name, 14400);
Utils.WriteCookie("AdminName", "MxWeiXinPF", model.user_name);
Utils.WriteCookie("AdminPwd", "MxWeiXinPF", model.password);
Response.Redirect("wxIndex.aspx");
return;
}
示例12: get_config
/// <summary>
/// 获取OAuth配置信息
/// </summary>
/// <param name="oauth_name"></param>
public static oauth_config get_config(string oauth_name)
{
//读取接口配置信息
Model.app_oauth model = new BLL.app_oauth().GetModel(oauth_name);
if (model != null)
{
//读取站点配置信息
Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(HotoKeys.FILE_SITE_XML_CONFING);
//赋值
oauth_config config = new oauth_config();
config.oauth_name = model.api_path.Trim();
config.oauth_app_id = model.app_id.Trim();
config.oauth_app_key = model.app_key.Trim();
config.return_uri = HotoUtils.DelLastChar(siteConfig.weburl, "/") + siteConfig.webpath + "api/oauth/" + model.api_path + "/return_url.aspx";
return config;
}
return null;
}
示例13: TenpayUtil
static TenpayUtil()
{
//��ȡXML������Ϣ
string fullPath = Utils.GetMapPath("~/xmlconfig/tenpay.config");
XmlDocument doc = new XmlDocument();
doc.Load(fullPath);
XmlNode _partner = doc.SelectSingleNode(@"Root/partner");
XmlNode _key = doc.SelectSingleNode(@"Root/key");
XmlNode _return_url = doc.SelectSingleNode(@"Root/return_url");
XmlNode _notify_url = doc.SelectSingleNode(@"Root/notify_url");
//��ȡվ��������Ϣ
Model.siteconfig model = new BLL.siteconfig().loadConfig();
partner = _partner.InnerText;
key = _key.InnerText;
return_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + _return_url.InnerText;
notify_url = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + _notify_url.InnerText;
}
示例14: TenpayUtil
public static string tenpay_return = ""; //��ʾ֧��֪ͨҳ��;
#endregion Fields
#region Constructors
static TenpayUtil()
{
//��ȡXML������Ϣ
string fullPath = HotoUtils.GetMapPath("~/xmlconfig/tenpay.config");
XmlDocument doc = new XmlDocument();
doc.Load(fullPath);
XmlNode _bargainor_id = doc.SelectSingleNode(@"Root/bargainor_id");
XmlNode _tenpay_key = doc.SelectSingleNode(@"Root/tenpay_key");
XmlNode _tenpay_return = doc.SelectSingleNode(@"Root/tenpay_return");
XmlNode _tenpay_notify = doc.SelectSingleNode(@"Root/tenpay_notify");
//��ȡվ��������Ϣ
Model.siteconfig model = new BLL.siteconfig().loadConfig(HotoKeys.FILE_SITE_XML_CONFING);
bargainor_id = _bargainor_id.InnerText;
tenpay_key = _tenpay_key.InnerText;
tenpay_return = HotoUtils.DelLastChar(model.weburl, "/") + _tenpay_return.InnerText;
tenpay_notify = HotoUtils.DelLastChar(model.weburl, "/") + _tenpay_notify.InnerText;
}
示例15: get_config
/// <summary>
/// 获取OAuth配置信息
/// </summary>
/// <param name="oauth_name"></param>
public static oauth_config get_config(string oauth_name)
{
//读取接口配置信息
Model.user_oauth_app model = new BLL.user_oauth_app().GetModel(oauth_name);
if (model != null)
{
//读取站点配置信息
Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig();
//赋值
oauth_config config = new oauth_config();
config.oauth_name = model.api_path.Trim();
config.oauth_app_id = model.app_id.Trim();
config.oauth_app_key = model.app_key.Trim();
config.return_uri = HttpContext.Current.Request.Url.Authority.ToLower() + siteConfig.webpath + "api/oauth/" + model.api_path + "/return_url.aspx";
return config;
}
return null;
}