学无止境

Life-long learning
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2008年8月4日

摘要: using System; class ArraySort { public static void Main() { int[] d = {10,15,21,43,17,98,2,74,63,10}; int temp; //冒泡法排序 for(int i=0; i<d.Length; i++) for(int j=i+1; j<d.Length; j++) ... 阅读全文

posted @ 2008-08-04 18:04 anytime8 阅读(608) 评论(0) 推荐(0) 编辑

摘要: using System; public class JiuJiuBiao { public static void Main(string[] args) { int i,j; for(i=1; i<10; i++) { for(j=1; j<10; j++) { Console.Write("{0:D1}*{1:D1}={2,2} ", i, j, i*j... 阅读全文

posted @ 2008-08-04 18:04 anytime8 阅读(277) 评论(0) 推荐(0) 编辑

摘要: using System; class StaticHello { public static void SayHello() { Console.WriteLine("Static Hello"); } } class NonStaticHello { public void SayHello() { Console.WriteLine("Non Static Hello"); } } ... 阅读全文

posted @ 2008-08-04 18:03 anytime8 阅读(185) 评论(0) 推荐(0) 编辑

摘要: using System; public class Person { public string name = ""; public int age = 0; //默认构造函数 public Person() { } //构造函数重载(1) public Person(int Age) { this.age = Age; } //构造函数重载(2) public Pe... 阅读全文

posted @ 2008-08-04 18:02 anytime8 阅读(186) 评论(0) 推荐(0) 编辑

摘要: using System; class Client { public static void Main() { //重载是指方法名相同,方法的签名不同 Console.WriteLine(Add(10,5)); Console.WriteLine(Add("10","5")); } public static string Add(string a, string b) ... 阅读全文

posted @ 2008-08-04 17:55 anytime8 阅读(189) 评论(0) 推荐(0) 编辑

摘要: using System; class Car { public virtual void Drive() { Console.WriteLine("Drive Car"); } } class Truck : Car { public override void Drive() { Console.WriteLine("Drive Truck"); } } class Client { ... 阅读全文

posted @ 2008-08-04 17:54 anytime8 阅读(183) 评论(0) 推荐(0) 编辑

摘要: using System; class Factor { public static void Main() { for(int i=1; i<=10; i++) Console.WriteLine("{0} 的阶乘是 {1}",i, Factorial(i)); } public static long Factorial(long n) { if(n == 1) ... 阅读全文

posted @ 2008-08-04 17:51 anytime8 阅读(615) 评论(0) 推荐(0) 编辑

摘要: using System; public class Hello { public static void Main() { Console.Write("请输入行数:"); int lines = int.Parse(Console.ReadLine()); Console.WriteLine(""); for(int i=1; i<=lines ; i++) { ... 阅读全文

posted @ 2008-08-04 17:50 anytime8 阅读(162) 评论(0) 推荐(0) 编辑

摘要: using System; class MethodCall { public static void Main() { /* * 参数类型分为 in, ref, out 三种,默认为 in。 * in 类型在子方法中修改了对应变量后,主方法中的值不会发生改变。 * ref 类型在子方法中修改了对应变量后,主方法中的值也会发生改变。 * out 主方法中对应的变量... 阅读全文

posted @ 2008-08-04 17:44 anytime8 阅读(220) 评论(0) 推荐(0) 编辑

2008年7月31日

摘要: css: body { margin: 0; padding: 0; font-family: Verdana, sans-serif; font-size: small; background: #fff; } input, select, textarea { border: 1px solid #0273a5; font-size: 12px; } a { color: ... 阅读全文

posted @ 2008-07-31 18:47 anytime8 阅读(1911) 评论(1) 推荐(0) 编辑

2008年7月30日

摘要: 1、彩色字体色彩绚丽 彩 色字体色彩 绚丽 2、阴影字体 阴影字体 3、围边字体 围边字体 体字边围 4、投影字体 投影字体 投影字体 5、抛射字体 抛射字体 6、带背景的闪光字体(背景图片可以换) 带背景的闪光字体(背景图片可以换) 7、向上移动的文字 向上移动的文字 ... 阅读全文

posted @ 2008-07-30 17:56 anytime8 阅读(504) 评论(1) 推荐(0) 编辑

摘要: 日常工作经常操作数据库 于是写了这个本人经常操作MSSQL数据库的一个类,希望有朋友能用到,代码纯粹只面向自己的常用操作 1 如果是ASP.NET 用户 配置WEB.CONFIG文件 2 JunvalMSSql的具体实现 using System; using System.Data; using System.Data.SqlClient; namespace Jun... 阅读全文

posted @ 2008-07-30 13:55 anytime8 阅读(638) 评论(1) 推荐(0) 编辑

摘要: 一、删除表格里重复某些值的数据行,并只保留一条记录! 条件:在表格里有一个唯一字段. DELETE FROM [表名] WHERE 唯一字段 (SELECT TOP 1 唯一字段 FROM (SELECT 唯一字段 FROM [表名]) WHERE 重复字段=重复数据) AND 重复字段=重复数据 比如:你的表格名是SM_Test .唯一字段是ID,重复字段是MemberName 重复数据是... 阅读全文

posted @ 2008-07-30 13:47 anytime8 阅读(461) 评论(0) 推荐(0) 编辑

摘要: SQL Server日期计算 a. 一个月的第一天 SELECT DATEADD(mm, DATEDIFF(mm,0,getdate()), 0) b. 本周的星期一 SELECT DATEADD(wk, DATEDIFF(wk,0,getdate()), 0) c. 一年的第一天 SELECT DATEADD(yy, DATEDIFF(yy,0,getdate()), 0) d. ... 阅读全文

posted @ 2008-07-30 13:43 anytime8 阅读(187) 评论(0) 推荐(0) 编辑

摘要: SQL语句先前写的时候,很容易把一些特殊的用法忘记,我特此整理了一下SQL语句操作。 一、基础 1、说明:创建数据库 CREATE DATABASE database-name 2、说明:删除数据库 drop database dbname 3、说明:备份sql server --- 创建 备份数据的 device USE master EXEC sp_addumpdevice 'disk'... 阅读全文

posted @ 2008-07-30 13:35 anytime8 阅读(161) 评论(0) 推荐(0) 编辑