2011年4月26日

基于DOM的XML操作(读、写、修改、删除)

摘要: XML 文档:<?xml version="1.0" encoding="utf-8"?><employees> <employee id="1"> <name> <firstName>Jack</firstName> <lastName>Wang</lastName> </name> <city>BeiJing</city> <state>BeiJing</state> < 阅读全文

posted @ 2011-04-26 13:21 缘来 阅读(507) 评论(0) 推荐(0)

2011年4月13日

gridview 导出成excel或word文件

摘要: protected void Button1_Click(object sender, EventArgs e){Export("application/ms-excel", "学生成绩报表.xls");//ms-doc 导出成word}private void Export(string FileType, string FileName) { //以下三行可选,如果没有的话导出的只是当前页数据,没有其他页数据 // GridView1.AllowPaging = false; //GridView1.AllowSorting = false; // 阅读全文

posted @ 2011-04-13 13:40 缘来 阅读(270) 评论(0) 推荐(0)

2011年4月12日

删除目录下所有文件及子文件夹

摘要: //删除目录下的所有文件及子文件夹 string strDeleteDir; strDeleteDir =路径 s(string path="D:\\SSIS";) deleteTmpFiles(strDeleteDir);以下为函数 #region 删除这个目录下的所有子目录和文件 //删除这个目录下的所有文件及文件夹 private void deleteTmpFiles(string strPath) { //删除这个目录下的所有子目录 if (Directory.GetDirectories(strPath).Length > 0) { foreach (st 阅读全文

posted @ 2011-04-12 15:33 缘来 阅读(340) 评论(0) 推荐(0)

2011年3月31日

MD5码加密

摘要: private String Encrypt(String pwd) { try { MD5 md5 = new MD5CryptoServiceProvider(); Byte[] b = Encoding.Default.GetBytes(pwd);//将待加密字符转为 字节型数组 Byte[] output = md5.ComputeHash(b);//将字节数组转为加密的字节数组 pwd = BitConverter.ToString(output).Replace("-", "");//将数字转为string 型去掉内部的无关字符 return 阅读全文

posted @ 2011-03-31 14:35 缘来 阅读(189) 评论(0) 推荐(0)

2011年3月17日

上传压缩文件到服务器并解压

摘要: protected void Button1_Click(object sender, EventArgs e) { string file = FileUpload1.FileName; string filename = file.Substring(file.LastIndexOf("\\") + 1); FileUpload1.SaveAs(Server.MapPath("File") + "\\" + filename); // string filepath = Server.MapPath("File" 阅读全文

posted @ 2011-03-17 13:12 缘来 阅读(720) 评论(0) 推荐(0)

2011年2月22日

WCF 服务器端App.config 配置

摘要: <?xml version="1.0" encoding="utf-8" ?><configuration> <system.serviceModel> <services> <service name="Sercice.Service" behaviorConfiguration="calculatorBehavior" > <host> <baseAddresses> <add baseAddress="http://localhost:8800"/> </baseAddresses> 阅读全文

posted @ 2011-02-22 12:51 缘来 阅读(971) 评论(0) 推荐(0)

2011年2月16日

禁止选中网页内容

摘要: body{ -moz-user-select:none; hutia:expression(this.onselectstart=function(){return(false)});} 阅读全文

posted @ 2011-02-16 14:06 缘来 阅读(137) 评论(0) 推荐(0)

2011年1月18日

横向导航菜单

摘要: ////横向导航菜单:style type="text/css"body { font-family: Verdana; font-size: 12px; line-height: 1.5; }a { color: #000; text-decoration: none; }a:hover { color: #F00; }#menu { width:800px; height:28px; margin:0 auto; border-bottom:3px solid #E10001;}#menu ul { list-style: none; margin: 0px; padding: 0px 阅读全文

posted @ 2011-01-18 16:17 缘来 阅读(377) 评论(0) 推荐(0)

MailMessage

摘要: ///mailmessage 发送邮件:protected void Button1_Click(object sender, EventArgs e) { string context =" 类别:"+ DropDownList1.Text +" 描述:"+ this.tbxBody.Text.Trim(); string name = this.tbxName.Text.Trim(); string to = this.tbxEmail.Text.Trim(); // string title = this.tbxSub.Text.Trim(); s 阅读全文

posted @ 2011-01-18 11:59 缘来 阅读(1165) 评论(0) 推荐(0)

浏览器兼容--CSS

摘要: ////不同浏览器,分辨率:<link href="" rel="stylesheet" type="text/css" /><script type= "text/javascript" language="JavaScript"> <!-- if (window.navigator.userAgent.indexOf("MSIE")>=1) { //如果浏览器为IEvar IE1024="default.css";v 阅读全文

posted @ 2011-01-18 11:52 缘来 阅读(394) 评论(0) 推荐(0)

导航