温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:功能很全asp.net图片水印组件源码2.0
当前文件路径:ImageWaterMark/Config_XML.aspx.cs

1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
using System.IO; 12
using System.Text; 13
//该源码下载自www.51aspx.com(51aspx.com) 14
15
namespace PanRoor 16
{ 17
public partial class XML : XMLX 18
{ 19
XMLX bind = new XMLX(); 20
protected void Page_Load(object sender, EventArgs e) 21
{ 22
23
if (!IsPostBack) 24
{ 25
colorloading(); 26
string[] FormValue = new string[] { "Bold", "Underline", "Italic", "Strikeout" }; 27
string[] FormName = new string[] { "加粗文本", "下划线文本", "倾斜文本", "中划线文本" }; 28
for (int i = 0; i < FormValue.Length; i++) 29
{ 30
ddl_Form.Items.Add(new ListItem(FormName[i].ToString(), FormValue[i].ToString())); 31
32
} 33
bind.getcolor(ref ddl_font); 34
rb_NoAndOff.SelectedValue = bind.XMLRead("NoAndOff"); 35
rb_PicAndText.SelectedValue = bind.XMLRead("PicAndText"); 36
tb_picpath.Text = bind.XMLRead("PicPath"); 37
tb_WM_Text.Text = bind.XMLRead("WM_Text"); 38
ddl_Location.SelectedValue = bind.XMLRead("WM_Location"); 39
tb_Transparence.Text = bind.XMLRead("WM_Transparence"); 40
tb_Angle.Text = bind.XMLRead("WM_Angle"); 41
ddl_font.SelectedValue = bind.XMLRead("Font"); 42
tb_FontSize.Text = bind.XMLRead("FontSize"); 43
tb_FontColor.Text = bind.XMLRead("FontColor"); 44
tb_FontShadow.Text = bind.XMLRead("FontShadow"); 45
ddl_Form.SelectedValue = bind.XMLRead("FontForm"); 46
tb_groundcolor.Text = XMLRead("Grounding"); 47
tb_PlaceX.Text = XMLRead("PlaceX"); 48
tb_PlaceY.Text = XMLRead("PlaceY"); 49
tb_ShadowX.Text = XMLRead("ShadowX"); 50
tb_ShadowY.Text = XMLRead("ShadowY"); 51
tb_ZipWidth.Text = XMLRead("ZipWidth"); 52
tb_ZipHeight.Text = XMLRead("ZipHeight"); 53
tb_MinWidth.Text = XMLRead("MinWidth"); 54
tb_MinHeight.Text = XMLRead("MinHeight"); 55
tb_MinPath.Text = XMLRead("MinPath"); 56
tb_SavePath.Text = XMLRead("SavePath"); 57
DropDownList1.SelectedValue = XMLRead("Effect"); 58
Txtshadowtransparence.Text = XMLRead("Txtshadowtransparence"); 59
PicVal.Text = XMLRead("PicVal"); 60
Mosaic.SelectedValue = XMLRead("Mosaic"); 61
txtmX.Text = XMLRead("txtmX"); 62
txtmY.Text = XMLRead("txtmY"); 63
txtmWidth.Text = XMLRead("txtmWidth"); 64
txtmHeight.Text = XMLRead("txtmHeight"); 65
Cut.SelectedValue = XMLRead("Cut"); 66
txtcX.Text = XMLRead("txtcX"); 67
txtcY.Text = XMLRead("txtcY"); 68
txtcWidth.Text = XMLRead("txtcWidth"); 69
txtcHeight.Text = XMLRead("txtcHeight"); 70
Miniature.SelectedValue = XMLRead("Miniature"); 71
DelPic.SelectedValue = XMLRead("DelPic"); 72
//51_a_s_p_x.c_o_m 73
74
} 75
} 76
77
protected void But_Save_Click1(object sender, EventArgs e) 78
{ 79
try 80
{ 81
if (Convert.ToInt32(tb_Transparence.Text) > 100) 82
Alert("透明度不支持大于100,请重设!"); 83
else 84
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); 85
86
colorloading(); 87
Alert("保存成功!"); 88
} 89
catch 90
{ 91
Alert("保存失败!"); 92
} 93
94
95
} 96
private void colorloading() 97
{ 98
tb_groundcolor.BackColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("Grounding")); 99
tb_groundcolor.ForeColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("Grounding")); 100
tb_FontColor.BackColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("FontColor")); 101
tb_FontColor.ForeColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("FontColor")); 102
tb_FontShadow.BackColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("FontShadow")); 103
tb_FontShadow.ForeColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("FontShadow")); 104
} 105
106
107
} 108
}





}
}