摘要: 1.新建数据库 广告位表、广告表广告表:Id,名字(Name,只是给管理员看的,不会显示到界面上),位置标识(PositionName,比如IndexHeader、IndexFooter,ViewThreadSeperator),广告类型(AdType,JavaScript、Image、Link)、JavaScript代码(JavaScriptCode,多行文本)、ImageUrl(广告图片的路径)、ImageTargetUrl(点击图片广告进入的路径)、LinkUrl(点击超链广告进入的路径)、LinkText(超链接的文本)。精细化的:选择不同的广告类型,显示不同的参数项。(DataIte 阅读全文
posted @ 2013-06-04 20:18 张国朋 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 1.定义RupengPager类代码:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Text;using System.Diagnostics;namespace SearchSite.Ctrls{ public class RupengPager { /// <summary> /// 总数据条数 /// </summary> public int TotalCount { get; ... 阅读全文
posted @ 2013-06-04 13:15 张国朋 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 基于 生产者消费者模式1.生产者生产出产品2.消费者不听的消费产品详细代码using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Threading;namespace 生产者消费者{ public partial class Form1 : Form { ... 阅读全文
posted @ 2013-06-04 12:49 张国朋 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 新建一个WebApplication,添加一个“应用程序配置文件”(App.config)添加对log4net.dll的引用在Web.Config (或App.Config)添加配置一、Log4Net配置<configuration> <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/> </configSections> <log4net 阅读全文
posted @ 2013-06-04 11:25 张国朋 阅读(214) 评论(0) 推荐(0) 编辑
摘要: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Ajax实例.aspx.cs" Inherits="jQuery.Ajax实例" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><ht 阅读全文
posted @ 2013-06-04 11:05 张国朋 阅读(211) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace linq1{ class Program { static void Main(string[] args) { int[] values = {2,3,4,5,46,56,67,576,-3,4 }; IEnumerable<int> e1 = values.Where(i => i > 0); forea... 阅读全文
posted @ 2013-06-04 10:10 张国朋 阅读(183) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Text.RegularExpressions;using System.IO;namespace 正则表达式{ class Program { static void Main(string[] args) { char[] ch = { '.','[',']','-'}; string ze = @"\d,\D,\w,\... 阅读全文
posted @ 2013-06-04 10:09 张国朋 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 序列化又称串行化,是.NET运行时环境用来支持用户定义类型的流化的机制。其目的是以某种存储形成使自定义对象持久化,或者将这种对象从一个地方传输到另一个地方。 什么是序列化? 我们都知道对象是暂时保存在内存中的,不能用U盘考走了,有时为了使用介质转移对象,并且把对象的状态保持下来,就需要把对象保存下来,这个过程就叫做序列化。通俗点就是把人的魂—对象,收伏成一个石子,可传输的介质。 什么叫反序列化? 就是再把介质中的东西还原成对象把石子还原成人的过程。 在进行这些操作的时候都需要这个可以被序列化,要能被序列化,就得给类头加[Serializable]特性。 通常网络程序为了传输安全... 阅读全文
posted @ 2013-06-04 10:04 张国朋 阅读(363) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Xml.Linq;using System.IO;namespace XML{ public partial class Form1 : Form { public Form1() ... 阅读全文
posted @ 2013-06-04 10:02 张国朋 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 一、数据库操作1、用完马上关闭数据库连接 访问数据库资源需要创建连接、打开连接和关闭连接几个操作。这些过程需要多次与数据库交换信息以通过身份验证,比较耗费服务器资源。ASP.NET中提供了连接池(Connection Pool)改善打开和关闭数据库对性能的影响。系统将用户的数据库连接放在连接池中,需要时取出,关闭时收回连接,等待下一次的连接请求。 连接池的大小是有限的,如果在连接池达到最大限度后仍要求创建连接,必然大大影响性能。因此,在建立数据库连接后只有在真正需要操作时才打开连接,使用完毕后马上关闭,从而尽量减少数据库连接打开的时间,避免出现超出连接限制的情况。用(推荐) using... 阅读全文
posted @ 2013-06-04 09:59 张国朋 阅读(278) 评论(0) 推荐(1) 编辑
摘要: string dataDir = AppDomain.CurrentDomain.BaseDirectory; if (dataDir.EndsWith(@"\bin\Debug\") || dataDir.EndsWith(@"\bin\Release\")) { dataDir = System.IO.Directory.GetParent(dataDir).Parent.Parent.FullName; AppDomain.CurrentDomain.SetData("DataDire... 阅读全文
posted @ 2013-06-04 09:55 张国朋 阅读(94) 评论(0) 推荐(0) 编辑
摘要: select t.Brand,s.Idfrom T_Customers as t join T_Seats as s on t.Id=s.Idselect t.Brand,s.Idfrom T_Customers as t join T_Seats as s on t.Id=s.Idwhere t.Age>(select AVG(age) from T_Customers)//子查询select * from T_Customersselect * from( select * from T_Customers)as s1In的用法select * from T_Customerswhe 阅读全文
posted @ 2013-06-04 09:54 张国朋 阅读(155) 评论(0) 推荐(0) 编辑
摘要: exec sp_databasesdeclare @Studnet intset @Studnet=243exec sp_helptext @Studnetexec sp_helptext 存储过程名--创建create proc usp_GetStudentById@Id intasselect * from Student where id=@Idalter proc usp_GetStudentByIdAndName@Id int,@Name varchar(10) --长度asselect * from Student where id=@Id and name=@Namealte.. 阅读全文
posted @ 2013-06-04 09:51 张国朋 阅读(386) 评论(0) 推荐(0) 编辑
摘要: CREATE VIEW [User](name,password,quxi) AS select Student.StudentName,Student.PassWord,Student.QuXi from Student union select Teacher.TeacherName,Teacher.PassWord,Teacher.QuXi from Teacher union select Manager.ManagerName,Manager.PassWord,Manager.QuXi from Manager;SELECT * FROM [Us... 阅读全文
posted @ 2013-06-04 09:49 张国朋 阅读(127) 评论(0) 推荐(0) 编辑
摘要: set @errornum=0begin transactionupdate Student set name='ewfeeeeeeeeeeeeeeeeeeeeeeeee' where id='1'set @errornum=@errornum+@@ERRORif(@errornum=0) begin commit transaction endelsebeginrollback transactionprint 'woaini'endselect * from Student where id='1'exec sp_databa 阅读全文
posted @ 2013-06-04 09:46 张国朋 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Transact-SQL中的存储过程,非常类似于Java语言中的方法,它可以重复调用。当存储过程执行一次后,可以将语句缓存中,这样下次执行的时候直接使用缓存中的语句。这样就可以提高存储过程的性能。Ø 存储过程的概念 存储过程Procedure是一组为了完成特定功能的SQL语句集合,经编译后存储在数据库中,用户通过指定存储过程的名称并给出参数来执行。 存储过程中可以包含逻辑控制语句和数据操纵语句,它可以接受参数、输出参数、返回单个或多个结果集以及返回值。 由于存储过程在创建时即在数据库服务器上进行了编译并存储在数据库中,所以存储过程运行要比单个的SQL语句块要快。同时由于在调用时只需用 阅读全文
posted @ 2013-06-04 09:44 张国朋 阅读(407) 评论(0) 推荐(0) 编辑
摘要: 常见浏览器兼容性问题与解决方案 所谓的浏览器兼容性问题,是指因为不同的浏览器对同一段代码有不同的解析,造成页面显示效果不统一的情况。在大多数情况下,我们的需求是,无论用户用什么浏览器来查看我们的网站或者登陆我们的系统,都应该是统一的显示效果。所以浏览器的兼容性问题是前端开发人员经常会碰到和必须要解决的问题。 在学习浏览器兼容性之前,我想把前端开发人员划分为两类: 第一类是精确按照设计图开发的前端开发人员,可以说是精确到1px的,他们很容易就会发现设计图的不足,并且在很少的情况下会碰到浏览器的兼容性问题,而这些问题往往都死浏览器的bug,并且他们制作的页面后期易维护,代码重用问题少,可以说... 阅读全文
posted @ 2013-06-04 09:35 张国朋 阅读(603) 评论(0) 推荐(1) 编辑
摘要: vs 的命令提示符直接运行 aspnet_regsql.exe打开编辑器,根据提示运行http://www.blueidea.com/tech/program/2007/4676.asp添加web.config文件<membership defaultProvider="mySqlMembershipProvider"> <providers> <add name="mySqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, S 阅读全文
posted @ 2013-06-04 09:33 张国朋 阅读(257) 评论(0) 推荐(0) 编辑
摘要: DataList控件的使用使用DataList控件本章内容:Ø 1、理解事件冒泡Ø 2、使用模板Ø 3、在DataList中显示数据Ø 4、在DataList中创建多列Ø 5、捕获DataList控件中产生的事件Ø 6、选择DataList中的项Ø 7、使用DataList控件中的DataKeys集合Ø 8、编辑DataList中的项本章介绍在ASP.NET框架中功能最强大的两个控件(DataList控件和DataGrid控件)之一的DataList控件。我们将深入探讨DataList控件,学习如何使用该控件显示数 阅读全文
posted @ 2013-06-04 09:28 张国朋 阅读(683) 评论(0) 推荐(0) 编辑
摘要: 页面缓存:在前台添加 <%@ OutputCache Duration="5" VaryByParam="none" %> 标签上述代码使用@OutputCatch指令声明了页面缓存,该页面将被缓存120秒。@OutputCatch指令包括10个属性,通过这些属性能够分别为页面的不同情况进行缓存设置,常用的属性如下所示:q CacheProfile:获取或设置OutputCacheProfile名称。q Duration:获取或设置缓存项需要保留在缓存中的时间。q VaryByHeader:获取或设置用于改变缓存项的一组都好分隔的HTTP标头 阅读全文
posted @ 2013-06-04 09:27 张国朋 阅读(237) 评论(0) 推荐(0) 编辑