您目前尚未登陆,请选择【登陆】或【注册
首页->控件插件->功能很全asp.net图片水印组件源码2.0>>App-Code/XML.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:功能很全asp.net图片水印组件源码2.0


当前文件路径:ImageWaterMark/App_Code/XML.cs 文件类型
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Web; 5using System.Web.Security; 6using System.Web.UI; 7using System.Web.UI.WebControls; 8using System.Web.UI.WebControls.WebParts; 9using System.Web.UI.HtmlControls; 10using System.IO; 11using System.Text; 12using System.Xml; 13using System.Xml.XPath; 14using System.Xml.Xsl; 15 16///Asp.net源码下载专业站 17 18namespace PanRoor 19{ 20 /// <summary> 21 /// XML 的摘要说明 22 /// </summary> 23 public class XMLX : Page 24 { 25 public XMLX() 26 { 27 // 28 // TODO: 在此处添加构造函数逻辑 29 // 30 } 31 public string CreateXML(string NoAndOff, string PicAndText, string PicPath, string WM_Text, string WM_Location, string WM_Transparence, string WM_Angle, string Font, string FontSize, string FontColor, string FontShadow, string FontForm, string mkcolor, string ShadowX, string ShadowY, string PlaceX, string PlaceY, string MinWidth, string MinHeight, string ZipWidth, string ZipHeight, string MinPath, string SavePath, string Effect, string Txtshadowtransparence, string PicVal, string Mosaic, string txtmX, string txtmY, string txtmWidth, string txtmHeight, string Cut, string txtcX, string txtcY, string txtcWidth, string txtcHeight, string Miniature,string DelPic) 32 { 33 //建一个新的空的XML文档 34 XmlTextWriter objXml = new XmlTextWriter(Server.MapPath("WM_Xml.xml"), null); 35 //格式化输出XML文档 36 objXml.Formatting = Formatting.Indented; 37 objXml.Indentation = 4; 38 //写入XML文档标记 39 objXml.WriteStartDocument(); 40 //写入XML文档注释 41 objXml.WriteComment("Created XML" + Context.Timestamp); 42 //写入根元素 43 objXml.WriteStartElement("WKConfig"); 44 //写入元素 45 objXml.WriteStartElement("Config"); 46 //写入属性 47 objXml.WriteAttributeString("Technology", "ASP.NET 2.0"); 48 //写入属性值 49 objXml.WriteAttributeString("Author", "张春根"); 50 //写入子元素及文本值 51 objXml.WriteElementString("Title", "水印参数配置"); 52 //写入子元素及文本值 53 objXml.WriteElementString("Version", "ImageWaterMark V2.0"); 54 //写入元素 55 objXml.WriteStartElement("Parameter"); 56 //写入子元素及文本值 57 objXml.WriteElementString("NoAndOff", NoAndOff); 58 objXml.WriteElementString("PicAndText", PicAndText); 59 objXml.WriteElementString("PicPath", PicPath); 60 objXml.WriteElementString("WM_Text", WM_Text); 61 objXml.WriteElementString("WM_Location", WM_Location); 62 objXml.WriteElementString("WM_Transparence", WM_Transparence); 63 objXml.WriteElementString("WM_Angle", WM_Angle); 64 objXml.WriteElementString("Font", Font); 65 objXml.WriteElementString("FontSize", FontSize); 66 objXml.WriteElementString("FontColor", FontColor); 67 objXml.WriteElementString("FontShadow", FontShadow); 68 objXml.WriteElementString("FontForm", FontForm); 69 objXml.WriteElementString("Grounding", mkcolor); 70 objXml.WriteElementString("ShadowX", ShadowX); 71 objXml.WriteElementString("ShadowY", ShadowY); 72 objXml.WriteElementString("PlaceX", PlaceX); 73 objXml.WriteElementString("PlaceY", PlaceY); 74 objXml.WriteElementString("MinWidth", MinWidth); 75 objXml.WriteElementString("MinHeight", MinHeight); 76 objXml.WriteElementString("ZipWidth", ZipWidth); 77 objXml.WriteElementString("ZipHeight", ZipHeight); 78 objXml.WriteElementString("MinPath", MinPath); 79 objXml.WriteElementString("SavePath", SavePath); 80 objXml.WriteElementString("Effect", Effect); 81 objXml.WriteElementString("Txtshadowtransparence", Txtshadowtransparence); 82 objXml.WriteElementString("PicVal", PicVal); 83 objXml.WriteElementString("Mosaic", Mosaic); 84 objXml.WriteElementString("txtmX", txtmX); 85 objXml.WriteElementString("txtmY", txtmY); 86 objXml.WriteElementString("txtmWidth", txtmWidth); 87 objXml.WriteElementString("txtmHeight", txtmHeight); 88 objXml.WriteElementString("Cut", Cut); 89 objXml.WriteElementString("txtcX", txtcX); 90 objXml.WriteElementString("txtcY", txtcY); 91 objXml.WriteElementString("txtcWidth", txtcWidth); 92 objXml.WriteElementString("txtcHeight", txtcHeight); 93 objXml.WriteElementString("Miniature", Miniature); 94 objXml.WriteElementString("DelPic", DelPic); 95 96 //关闭子元素、元素、根元素 97 objXml.WriteEndElement(); 98 objXml.WriteEndElement(); 99 objXml.WriteEndElement(); 100 //清除缓存 101 objXml.Flush(); 102 //关闭对象 103 objXml.Close(); 104 return ""; 105 } 106 public string XMLRead(string Value) 107 { 108 109 XmlDocument xd = new XmlDocument(); 110 xd.Load(Server.MapPath("WM_Xml.xml")); 111 112 XmlNodeList xnl = xd.GetElementsByTagName(Value); 113 if (xnl.Count == 0) 114 return ""; 115 else 116 { 117 XmlNode mNode = xnl[0]; 118 return mNode.InnerText; 119 } 120 } 121 public void getcolor(ref DropDownList ddlfont) 122 { 123 124 125 ddlfont.Items.Clear(); 126 System.Drawing.Text.InstalledFontCollection font; 127 font = new System.Drawing.Text.InstalledFontCollection(); 128 foreach (System.Drawing.FontFamily family in font.Families) 129 { 130 ddlfont.Items.Add(family.Name); 131 } 132 133 134 } 135 public static string HexEncoding(System.Drawing.Color color) 136 { 137 string R, G, B; 138 string strHexEncoding; 139 140 R = color.R.ToString("X"); 141 G = color.G.ToString("X"); 142 B = color.B.ToString("X"); 143 144 R = R.Length == 1 ? "0" + R : R; 145 G = G.Length == 1 ? "0" + G : G; 146 B = B.Length == 1 ? "0" + B : B; 147 148 strHexEncoding = "#" + R + G + B; 149 150 return strHexEncoding; 151 152 153 } 154 155 public void Messages(string Message, string href) 156 { 157 this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script language=\"javascript\">alert('" + Message + "');location.href='" + href + "'</script>"); 158 159 } 160 public void Alert(string msg) 161 { 162 this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script language=\"javascript\">alert('" + msg + "');</script>"); 163 } 164 } 165}
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:功能很全asp.net图片水印组件源码2.0

- 大学生调查投票系统源码

- 51aspxRSS阅读器源码(含详细..

- AjaxPro.NET实现的简单高效的..

- 逐迹内容管理系统AspxNuke v..

- 达达ASP.NET企业信息管理系统

- 川农跳骚市场程序源码

- Ajax无刷新中文验证码

- 客户关系拓展管理系统源码

51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号