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 阅读(143) 评论(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 阅读(2037) 评论(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 阅读(1539) 评论(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 阅读(93505) 评论(2) 推荐(1) 编辑

ASP.NET的身份验证方式有哪些

摘要: [Forms 身份验证] 通过其可将没有通过身份验证的请求重定向到使用 HTTP 客户端重定向的 HTML 窗体的系统。用户提供凭据并提交该窗体。如果应用程序验证该请求,系统就会发出包含凭据或密钥的 Cookie 以重新获取该标识。后续的请求在请求标题中随 Cookie 一起发出,ASP.NET 事件处理程序会使用应用程序开发人员指定的任何验证方法去验证请求并给其授权。 [Passport 身份验证] 由 Microsoft 提供的集中身份验证服务,用于为成员站点提供单一登录和核心配置服务。 [Windows 身份验证] ASP.NET 会结合 Internet 信息服务 (IIS) 身份验证 阅读全文

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

帮助链接收集

摘要: WCF详解:http://www.cnblogs.com/artech/archive/2007/02/26/656901.html系统操作日志:http://www.cnblogs.com/samlin/archive/2010/02/08/Log-Operation-Management.htmlasp.net插入播放flash视频:http://feilong.org/asp-net-insert-flash-swf-flv 阅读全文

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

去除字符串中的重复项

摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 倒序{ class Program { public static string Get(string str) { String[] s = str.Split(new char[] { ';' }); List<string> list = new List<string>(); foreach (string a in s) { if (!list.Contains( 阅读全文

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

导航