08 2012 档案

摘要:View Code 1 using System; 2 using System.Data; 3 using System.Data.SqlClient; 4 using System.Collections.Generic; 5 using System.Linq; 6 public class StudyModel 7 { 8 public static void Main() 9 {10 string strcon = "server = .;database = blog;uid = sa;pwd = 1;";11 SqlConnect... 阅读全文
posted @ 2012-08-08 20:20 晓 漪 阅读(1090) 评论(2) 推荐(0)
摘要:View Code 1 using System; 2 using System.Data; 3 using System.Data.SqlClient; 4 public class Helper 5 { 6 public static void Main() 7 { 8 //连接字符串 9 string strcon = "server = .;database = blog;uid = sa;pwd = 1"; 10 SqlHelper helper = new SqlHelper(strcon); 11... 阅读全文
posted @ 2012-08-08 20:06 晓 漪 阅读(1023) 评论(0) 推荐(0)
摘要:View Code 1 using System; 2 using System.Data; 3 using System.Data.SqlClient; 4 public class StudyReader 5 { 6 public static void Main() 7 { 8 //连接字符串 9 string strcon = "server = .;database = blog;uid = sa;pwd = 1";10 SqlConnection con = new SqlConnection (strcon);11... 阅读全文
posted @ 2012-08-08 19:50 晓 漪 阅读(350) 评论(0) 推荐(0)
摘要:View Code 1 //求200以内偶数的和 2 declare @a int 3 declare @sum int 4 set @a = 0 5 set @sum = 0 6 while(@a<=200) 7 begin 8 set @a = @a + 1 9 if(@a%2 = 0)10 begin11 set @sum = @sum+@a12 end13 end14 print @sum15 16 17 //求10的阶乘18 declare @b int19 declare @c int20 set @... 阅读全文
posted @ 2012-08-04 11:16 晓 漪 阅读(196) 评论(1) 推荐(0)
摘要:View Code 1 using System; 2 public delegate void Del(); 3 public class Observer 4 { 5 public static void Main() 6 { 7 Alarm alarm = new Alarm(); 8 alarm.sl =()=>{Console.WriteLine("快开了,加油哦");}; 9 alarm.si =()=>{Console.WriteLine("嘟嘟");};10 alarm.Jia();11 ... 阅读全文
posted @ 2012-08-04 11:09 晓 漪 阅读(279) 评论(0) 推荐(0)
摘要:View Code 1 using System; 2 public class GetValue 3 { 4 /*为People扩展一个方法ToValue 5 要求为:能把People里面所有属性的值打印出来*/ 6 public static void Main() 7 { 8 People people = new People(); 9 people.Get("康熙",300);10 }11 }12 public static class ToValue13 {14 public static void G... 阅读全文
posted @ 2012-08-04 10:49 晓 漪 阅读(361) 评论(0) 推荐(0)
摘要:View Code 1 //问题:1,查询出str中以@符号开头的 2 //2,查询出Str中元素长度大于5的元素 3 using System; 4 using System.Linq; 5 public class StudyLinq 6 { 7 public static void Main() 8 { 9 string[] str = {"abcd","apple","@symjie","banana","orange"};10 var s = str.Where(p=>p.Sta 阅读全文
posted @ 2012-08-01 19:59 晓 漪 阅读(445) 评论(0) 推荐(0)
摘要:View Code 1 //1,查询出list中所有女生并且年龄小于18,并按降序排列 2 //2,查询出list中名字为“王”开头,并且长度为3的学生 3 using System; 4 using System.Collections.Generic; 5 using System.Linq; 6 public class StudyLinq 7 { 8 public static void Main() 9 {10 List<People> list = new List<People>();11 list.Add(new People(... 阅读全文
posted @ 2012-08-01 19:36 晓 漪 阅读(11811) 评论(1) 推荐(0)
摘要:View Code 1 //实现checkbox的全选和取消 2 <script type="text/javascript"> 3 function all(all){ 4 var checkbox = document.getElementsByName("select"); 5 if (all.checked){ 6 for (i = 0;i<checkbox.length ;i++ ) 7 { 8 checkbox[i].checked = true; 9 ... 阅读全文
posted @ 2012-08-01 19:30 晓 漪 阅读(200) 评论(0) 推荐(0)
摘要:View Code 1 //实现局部遮罩 2 <script type="text/javascript"> 3 function Shade(){ 4 var s = document.getElementById("shade"); 5 s.style.display = "block"; 6 } 7 function Display(){ 8 var d = document.getElementById("shade"); 9 d.style.display = "none" 阅读全文
posted @ 2012-08-01 19:25 晓 漪 阅读(469) 评论(0) 推荐(0)
摘要:View Code 1 //有两个按钮分别响应两个事件,用来控制iframe显示的网页。 2 <script type="text/javascript"> 3 function bd(){ 4 var baidu = document.getElementById("i"); 5 baidu.src = "http://www.baidu.com"; 6 } 7 function xl(){ 8 var sina = document.getElementById("i"); 9 sina.src = 阅读全文
posted @ 2012-08-01 19:22 晓 漪 阅读(788) 评论(0) 推荐(0)