Monday, January 25, 2010

Config_XML.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Text;
//该源码下载自www.51aspx.com(51aspx.com)

namespace PanRoor
{
public partial class XML : XMLX
{
XMLX bind = new XMLX();
protected void Page_Load(object sender, EventArgs e)
{

if (!IsPostBack)
{
colorloading();
string[] FormValue = new string[] { "Bold", "Underline", "Italic", "Strikeout" };
string[] FormName = new string[] { "加粗文本", "下划线文本", "倾斜文本", "中划线文本" };
for (int i = 0; i < FormValue.Length; i++)
{
ddl_Form.Items.Add(new ListItem(FormName[i].ToString(), FormValue[i].ToString()));

}
bind.getcolor(ref ddl_font);
rb_NoAndOff.SelectedValue = bind.XMLRead("NoAndOff");
rb_PicAndText.SelectedValue = bind.XMLRead("PicAndText");
tb_picpath.Text = bind.XMLRead("PicPath");
tb_WM_Text.Text = bind.XMLRead("WM_Text");
ddl_Location.SelectedValue = bind.XMLRead("WM_Location");
tb_Transparence.Text = bind.XMLRead("WM_Transparence");
tb_Angle.Text = bind.XMLRead("WM_Angle");
ddl_font.SelectedValue = bind.XMLRead("Font");
tb_FontSize.Text = bind.XMLRead("FontSize");
tb_FontColor.Text = bind.XMLRead("FontColor");
tb_FontShadow.Text = bind.XMLRead("FontShadow");
ddl_Form.SelectedValue = bind.XMLRead("FontForm");
tb_groundcolor.Text = XMLRead("Grounding");
tb_PlaceX.Text = XMLRead("PlaceX");
tb_PlaceY.Text = XMLRead("PlaceY");
tb_ShadowX.Text = XMLRead("ShadowX");
tb_ShadowY.Text = XMLRead("ShadowY");
tb_ZipWidth.Text = XMLRead("ZipWidth");
tb_ZipHeight.Text = XMLRead("ZipHeight");
tb_MinWidth.Text = XMLRead("MinWidth");
tb_MinHeight.Text = XMLRead("MinHeight");
tb_MinPath.Text = XMLRead("MinPath");
tb_SavePath.Text = XMLRead("SavePath");
DropDownList1.SelectedValue = XMLRead("Effect");
Txtshadowtransparence.Text = XMLRead("Txtshadowtransparence");
PicVal.Text = XMLRead("PicVal");
Mosaic.SelectedValue = XMLRead("Mosaic");
txtmX.Text = XMLRead("txtmX");
txtmY.Text = XMLRead("txtmY");
txtmWidth.Text = XMLRead("txtmWidth");
txtmHeight.Text = XMLRead("txtmHeight");
Cut.SelectedValue = XMLRead("Cut");
txtcX.Text = XMLRead("txtcX");
txtcY.Text = XMLRead("txtcY");
txtcWidth.Text = XMLRead("txtcWidth");
txtcHeight.Text = XMLRead("txtcHeight");
Miniature.SelectedValue = XMLRead("Miniature");
DelPic.SelectedValue = XMLRead("DelPic");
//51_a_s_p_x.c_o_m

}
}

protected void But_Save_Click1(object sender, EventArgs e)
{
try
{
if (Convert.ToInt32(tb_Transparence.Text) > 100)
Alert("透明度不支持大于100,请重设!");
else
bind.CreateXML(rb_NoAndOff.SelectedValue, rb_PicAndText.SelectedValue, tb_picpath.Text, tb_WM_Text.Text, ddl_Location.SelectedValue, tb_Transparence.Text, tb_Angle.Text, ddl_font.SelectedValue, tb_FontSize.Text, tb_FontColor.Text, tb_FontShadow.Text, ddl_Form.SelectedValue, tb_groundcolor.Text, tb_ShadowX.Text, tb_ShadowY.Text, tb_PlaceX.Text, tb_PlaceY.Text, tb_MinWidth.Text, tb_MinHeight.Text, tb_ZipWidth.Text, tb_ZipHeight.Text, tb_MinPath.Text, tb_SavePath.Text, DropDownList1.SelectedValue,Txtshadowtransparence.Text,PicVal.Text,Mosaic.SelectedValue,txtmX.Text,txtmY.Text,txtmWidth.Text,txtmHeight.Text,Cut.SelectedValue,txtcX.Text,txtcY.Text,txtcWidth.Text,txtcHeight.Text,Miniature.SelectedValue,DelPic.SelectedValue);

colorloading();
Alert("保存成功!");
}
catch
{
Alert("保存失败!");
}


}
private void colorloading()
{
tb_groundcolor.BackColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("Grounding"));
tb_groundcolor.ForeColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("Grounding"));
tb_FontColor.BackColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("FontColor"));
tb_FontColor.ForeColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("FontColor"));
tb_FontShadow.BackColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("FontShadow"));
tb_FontShadow.ForeColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("FontShadow"));
}


}
}

No comments:

Post a Comment