11 2011 档案

.net 程序开发笔试题
摘要:1、.net中读写数据库需要用到哪些类?他们的作用分别是什么?答: Command类 执行语句命令DataSet类 数据存储器 DataAdapter类数据的集合,用于填充。2、DataSet 与sqldatareader 有什么区别?答:本质上:sqldatareader 是只读的,DataSet 是可读可写的 从读取速度上讲,sqldatareader 的速度要快一些。 举个例子: sqldatareader 方式只是节约内存,一边读取数据一边处理数据,如果处理一条数据消耗时间约1s,那么处理10条数据就是10s;在这10s内如果有第二个人同时访问这个数据库就打不开了,必须关闭sqldat 阅读全文

posted @ 2011-11-22 11:24 zg_heng 阅读(2057) 评论(0) 推荐(1)

.net 页面传参方式总结
摘要:ASP.NET为我们提供了三种方式,一种是可以通过用QueryString来传送相应的值,再一种是通过session变量来传送相应的值,还有就是 通过Server.Transfer方法来实现。下面分别一一介绍:一、使用QuerystringQuerystring是一种非常简单的传值方式,其缺点就是:安全性低。会把要传送的值显示在浏览器的地址栏中(也就是不需要保密得参数),并且在此方法中不能够传递对象,参数的长度不能大于 1024字节(?),当参数中有中文得时候,通常需要使用HttpUlitity.UrlEncode方法来对参数进行编码和解码。优点:速度快。如果你想传递一个安全性不是那么太重要或 阅读全文

posted @ 2011-11-19 16:28 zg_heng 阅读(6599) 评论(3) 推荐(2)

using 的几种用法
摘要:1、using指令。即导入命名空间。 using + 命名空间名字,这样可以在程序中直接用命令空间中的类型,而不必指定类型的详细命名空间,类似于Java的import,这个功能也是最常用的,几乎每个cs的程序都会用到。 例如:using System; 一般都会出现在*.cs中。2、using别名。using + 别名 = 包括详细命名空间信息的具体的类型。这种做法有个好处就是当同一个cs引用了两个不同的命名空间,但两个命名空间都包括了一个相同名字的类型的时候。当需要用到这个类型的时候,就每个地方都要用详细命名空间的办法来区分这些相同名字的类型。而用别名的方法会更简洁,用到哪个类就给哪个类做别 阅读全文

posted @ 2011-11-18 19:59 zg_heng 阅读(701) 评论(0) 推荐(2)

有关日期、时间、星期
摘要: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 阅读(151) 评论(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 阅读(187) 评论(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 阅读(99) 评论(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 阅读(197) 评论(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 阅读(666) 评论(0) 推荐(0)

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

posted @ 2011-11-14 11:56 zg_heng 阅读(495) 评论(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 阅读(1494) 评论(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 阅读(2045) 评论(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 阅读(1546) 评论(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 阅读(93533) 评论(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 阅读(1028) 评论(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 阅读(114) 评论(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 阅读(248) 评论(0) 推荐(0)

导航