摘要: 关于CSS对各个浏览器兼容已经是老生常谈的问题了, 网络上的教程遍地都是.以下内容没有太多新颖, 纯属个人总结, 希望能对初学者有一定的帮助.一、CSS HACK 以下两种方法几乎能解决现今所有HACK.1, !important随着IE7对!important的支持, !important ... 阅读全文
posted @ 2014-07-09 09:42 shaoyi52 阅读(358) 评论(0) 推荐(0) 编辑
摘要: //菜单下拉function menu(){ var oNav=document.getElementById('top-menu'); var aLi=oNav.getElementsByTagName('li'); for(var m=0;m<aLi.length;m++) { ... 阅读全文
posted @ 2014-06-17 10:01 shaoyi52 阅读(152) 评论(0) 推荐(0) 编辑
摘要: web.config的配置 DbHelperOleDb.cs 的类方法//数据库连接字符串(web.config来配置),可以动态更改connectionString支持多数据库。public static string connectionString=ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString.ToString()+HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["D 阅读全文
posted @ 2014-02-14 11:37 shaoyi52 阅读(510) 评论(1) 推荐(1) 编辑
摘要: 功能说明:在此例中,try 块包含对可能导致异常的ProcessString()方法的调用.catch子句包含仅在屏幕上显示消息的异常处理程序,当从ProcessString内部调用throw语句时,系统查找Catch语句并显示Exception caught消息. class Try_Test1 { static void processString(string s) { if (s == null) { throw new ArgumentNullException(); } } static void Main() { try { string s = null; processStr 阅读全文
posted @ 2013-10-26 12:54 shaoyi52 阅读(258) 评论(0) 推荐(0) 编辑
摘要: //用迭代算法算出第m个值 //1,1,2,3,5,8...;//{1,0+1,1+1,1+2,2+3 ,3+5} static void Main(string[] args)//Main方法 必须为静态方法 可以void (无返回参数)或者int (整型返回类型) { int sum = 1; int persum= 0; int m = Convert.ToInt32(Console.ReadLine()); int [] bn=new int[m+1]; bn[0] = 0; for (int i = 1; i<= m; i++) { bn[i] = bn[i-1]; s... 阅读全文
posted @ 2013-10-26 02:06 shaoyi52 阅读(489) 评论(0) 推荐(0) 编辑
摘要: //用Parse方法将字符串转换为数值类型;long num=Int64.Parse(args[2])//用别名为Int64c#类型long;long num=long.Parse(args[2])//还可以使用Convert类的方法ToInt64完成同样的工作;long num =Convert.toInt(s);foreach 可以访问数组,集合类或任何实现IEnumerable接口的类或结构 阅读全文
posted @ 2013-10-26 02:05 shaoyi52 阅读(352) 评论(0) 推荐(0) 编辑
摘要: class class1//类 { } interface interface1//接口 { } struct struct1//结构 { } delegate int delegate1();//委托 enum Enum1 { } class Program//类 { static void Main(string[] args)//Main方法 必须为静态方法 可以void (无返回参数)或者int (整型返回类型) { } } namespace namespace1 //命名空间 { struct struct2 //结构 { } } 阅读全文
posted @ 2013-10-25 23:45 shaoyi52 阅读(91) 评论(0) 推荐(0) 编辑