摘要: // DataTable转化为Json对象public string DataTableToJson(string jsonName, DataTable dt) { StringBuilder Json = new StringBuilder(); Json.Append("{\"" + jsonName + "\":["); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { Json.Append("{"); for 阅读全文
posted @ 2011-07-20 10:20 xuebingz 阅读(332) 评论(1) 推荐(0)
摘要: public class xmltoJson { public string XmlToJSON(XmlElement xmlDoc) { StringBuilder sbJSON = new StringBuilder(); sbJSON.Append("{ "); XmlToJSONnode(sbJSON, xmlDoc, true); sbJSON.Append("}"); return sbJSON.ToString(); } // XmlToJSONnode: Output an XmlElement, possibly as part of 阅读全文
posted @ 2011-07-20 10:16 xuebingz 阅读(406) 评论(1) 推荐(0)
摘要: MagicAjax的用法1.在MagicAjax.net里下载MagicAjax的压缩包。 把MagicAjax.dll添加引用到你的项目的bin目录下面。2.在工具箱添加MagicAjax3.在web.config中的添加 <configSections> <section name="magicAjax" type="MagicAjax.Configuration.MagicAjaxSectionSectionHandler,MagicAjax" /> </configSections> <system.we 阅读全文
posted @ 2011-06-17 11:36 xuebingz 阅读(269) 评论(1) 推荐(0)
摘要: WebPart运行时右上角的最大化,最小化,关闭按钮没有出现的解决办法:1)在web.config文件中把<authentication>的mode 改成“Windows”验证。2)在Login.aspx的Button_Click事件中加上 FormsAuthentication.RedirectFromLoginPage("用户名",false); Response.Redirect("自己定义的webPart页面"); (Login.aspx,如何你没有定义Login.aspx页面,它会在你的项目的Account文件夹里有。 阅读全文
posted @ 2011-05-17 14:28 xuebingz 阅读(301) 评论(1) 推荐(0)
摘要: /// < summary> ///将xml转化为html /// < /summary> /// < param name="XmlPath">xml文件路径< /param> /// < param name="XslFilePath">xslt文件路径< /param> /// < param name="htmlFilePath">声称的html文件路径< /param> public static void XmlTransToH 阅读全文
posted @ 2011-05-05 14:47 xuebingz 阅读(544) 评论(0) 推荐(0)
摘要: using System;using System.Globalization;namespace ConvertDateTime{/// <summary>/// ConvertDateTime の概要の説明です。/// </summary>public class ConvertDate{ public ConvertDate() {} //*******************************************************************// #region 根据当前日期确定当前是星期几 public static string 阅读全文
posted @ 2011-04-29 15:33 xuebingz 阅读(912) 评论(1) 推荐(0)
摘要: public static class DBHelper { //数据库连接属性 private static SqlConnection connection; public static SqlConnection Connection { get { string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; if (connection == null) { connection = new SqlConnection(c 阅读全文
posted @ 2011-04-22 16:24 xuebingz 阅读(2006) 评论(0) 推荐(0)
摘要: -----后台代码------/// <summary>///GetSubString 的摘要说明/// </summary>public class GetSub{ /// <summary> /// 去除HTML标记 /// </summary> /// <param name="Htmlstring"></param> /// <returns></returns> public static string NoHTML(string Htmlstring) { if (H 阅读全文
posted @ 2011-04-20 10:26 xuebingz 阅读(316) 评论(0) 推荐(0)
摘要: var query2 = from f in doc_US_Fundamentals_xml.Descendants("上市公司") join t in doc_US_Technicalxml.Descendants("上市公司") on f.Attribute("代码").Value equals t.Attribute("代码").Value where f.Attribute("代码").Value.Equals(code) select new { yMinPrice = t.Attri 阅读全文
posted @ 2011-04-20 09:51 xuebingz 阅读(234) 评论(0) 推荐(0)
摘要: ///<summary>///根据文件目录匹配对应的str的文件///</summary>///<param name="basePath">文件夹</param>///<param name="str">相同的文件前缀</param>///<returns></returns>public static ArrayList getFiles(string basePath,string str){ if(Directory.Exists(basePath)= 阅读全文
posted @ 2011-04-20 09:33 xuebingz 阅读(293) 评论(0) 推荐(0)