2011年11月14日

有关日期、时间、星期

摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace gettime{ class Program { static void Main(string[] args) { string str = "2011/11/12 "; int dt =Int32.Parse (DateTime.Parse(str).DayOfYear.ToString());//所表示的日期是该年中的第几天; string week = DateTime.Parse(s 阅读全文

posted @ 2011-11-14 12:00 zg_heng 阅读(142) 评论(0) 推荐(0) 编辑

杨辉三角

摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace yanghuisanjiao{ class Program { static void Main(string[] args) { //方法一: int[,] a = new int[5, 5]; a[0, 0] = 1; for (int i = 1; i < 5; i++) { a[i, 0] = 1; a[i, i] = 1; for (int j = 1; j < i; j++) { a[i, 阅读全文

posted @ 2011-11-14 11:59 zg_heng 阅读(93) 评论(0) 推荐(0) 编辑

阶乘

摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace jiecheng{ class Program { static void Main(string[] args) { int i, n; double sum = 1; Console.WriteLine("请输入n的值:"); n = int.Parse(Console.ReadLine()); for (i = 1; i <= n; i++) sum *= i; Console.W 阅读全文

posted @ 2011-11-14 11:59 zg_heng 阅读(182) 评论(0) 推荐(0) 编辑

冒泡排序+二分之查找

摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 二分支查找{ class Program { static void Main(string[] args) { int[] data = new int[] { 3, 0, 4, 3, 7 }; Console.WriteLine(Get(data, -1)); Console.ReadLine(); } public static int Get(int[] data, int a) { int positi 阅读全文

posted @ 2011-11-14 11:58 zg_heng 阅读(193) 评论(0) 推荐(0) 编辑

将一个字符串倒序

摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;namespace paixu{ class Program { public static StringBuilder Get(string str) { char[] dd = str.ToCharArray(); IEnumerable<char> aa = dd.Reverse(); StringBuilder sb = new StringBuilder(); 阅读全文

posted @ 2011-11-14 11:57 zg_heng 阅读(662) 评论(0) 推荐(0) 编辑

ASP.NET 预编译站点 摘抄

摘要: 默认情况下,在用户首次请求资源(如网站的一个页)时,将动态编译 ASP.NET 网页和代码文件。第一次编译页和代码文件之后,会缓存编译后的资源,这样将大大提高随后对同一页提出的请求的效率。ASP.NET 还可以预编译整个站点,然后再提供给用户使用。这样做有很多好处,其中包括:可以加快用户的响应时间,因为页和代码文件在第一次被请求时无需编译。这对于经常更新的大型站点尤其有用。 可以在用户看到站点之前识别编译时 bug。可以创建站点的已编译版本,并将该版本部署到成品服务器,而无需使用源代码。就地预编译 ASP.NET 网站打开一个命令窗口并定位到包含 .NET Framework 的文件夹。.NE 阅读全文

posted @ 2011-11-14 11:56 zg_heng 阅读(488) 评论(0) 推荐(0) 编辑

div 圆边框 摘抄一

摘要: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns=" http://www.w3.org/1999/xhtml" lang="zh-CN"><head><meta http-equiv="Content-Type" content=&quo 阅读全文

posted @ 2011-11-14 11:52 zg_heng 阅读(1490) 评论(0) 推荐(0) 编辑

div 圆边框(用图片) 摘抄二

摘要: 我使用的图像和上面有点不同,只是四个边框。当宽度变小时,右边的图像会覆盖左边的图像。当高度变小时,上面的图像会覆盖下面的。所以图像的覆盖顺序是这样的(从被覆盖到覆盖):buttom-left <—— buttom.right <—— top-right <—— top.left四个图像,需要四个Html元素,所以它的Html不可避免使用了额外的div,如下:复制代码代码如下:<div class="box"> <div class="box-outer"> <div class="box-inne 阅读全文

posted @ 2011-11-14 11:52 zg_heng 阅读(2035) 评论(0) 推荐(0) 编辑

sql 的一些语句总结

摘要: /× 创建一个数据库*/CREATE DATABASE Drug ON PRIMARY(NAME='Drug',FILENAME='D:\Drug.mdf',SIZE=3027KB,MAXSIZE=UNLIMITED,FILEGROWTH=1024KB)LOG ON (NAME='Drug_LOG',FILENAME='D:\Drug.ldf',SIZE=1024,FILEGROWTH=10%)USE[Drug]GO/×创建一个用户表*/CREATE TABLE userinfo(id int identity 阅读全文

posted @ 2011-11-14 11:51 zg_heng 阅读(1538) 评论(0) 推荐(0) 编辑

CSS3实现背景颜色渐变 摘抄

摘要: 一. Webkit浏览器 (1) 第一种写法: background:-webkit-gradient(linear ,10% 10%,100% 100%, color-stop(0.14,rgb(255,0,0)), color-stop(0.5,rgb(255,255,0)), color-stop(1,rgb(0,0,255))); 第一个参数:表示的是渐变的类型 linear线性渐变 第二个参数:分别对应x,y方向渐变的起始位置 第三个参数:分别对应x,y方向渐变的终止位置 第四/五/N个参数:设置渐变的位置及颜色 (2)第二种写法:这种写法比较简单,而且效果比较自然 back... 阅读全文

posted @ 2011-11-14 11:50 zg_heng 阅读(93503) 评论(2) 推荐(1) 编辑

导航