本文整理匯總了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;
}