- 博客(39)
- 资源 (1)
- 收藏
- 关注
原创 一般网站数据搜索的功能实现
1.首先写出搜索条件类例如以下代码: /// /// 搜索条件 /// public class SearchBookCriterion { public string title = null; public DateTime? date1 = n
2011-10-22 23:44:32
1603
3
原创 Cookie的添加删除使用
Cookie 是一小段文本信息,伴随着用户请求和页面在 Web 服务器和浏览器之间传递。Cookie 包含每次用户访问站点时 Web 应用程序都可以读取的信息。例如,如果在用户请求站点中的页面时应用程序发送给该用户的不仅仅是一个页面,还有一个包含日期和时间的 Cookie
2011-10-16 22:55:27
473
原创 事件的理解
public Form1() { InitializeComponent(); this.button1.Click += new EventHandler(btn1_click);
2011-10-13 16:33:02
320
原创 Int32.TryParse,int.Parse,Convert.ToInt32类型转换比较
Convert.ToInt32()在null时不会抛出异常,而是返回0int.Parse()在null时会抛出异常Int32.TryParse()不会抛出异常,会返回true或false,如果解析错误返回false,out返回0从性能上:Int32.TryParse(
2011-10-13 10:55:56
2019
原创 C#文件编译
1.csc Demo.cs2.csc /target:library Demo.cs -------生成Demo.dll3.csc /out:Test.exe Demo.cs -------生成Test.exe4.csc /target:library /
2011-10-13 10:15:57
345
原创 存储过程调用
set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo-- =============================================-- Author: -- Create date: -- Desc
2011-10-10 17:26:35
258
转载 文件流代码
class Program { static void Main(string[] args) { string sfile = @"e:\test\demo.txt"; //RWF
2011-10-09 11:21:56
325
原创 字符串的连接及分割
static void Main(string[] args) { string[] names = { "我", "是", "中", "国", "人" }; Console.WriteLine(string.
2011-10-09 09:41:57
445
原创 简单文件上传
<br /> protected void Button1_Click(object sender, EventArgs e)<br /> {<br /> if (FileUpload1.HasFile)<br /> {<br /> string strFileName = FileUpload1.FileName;<br /> Response.Write(strFileName);<br /> st
2011-05-20 16:41:00
269
原创 圆心与圆周围点的位置
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 综合练习{ /// /// 点的构造函数 /// public struct Point { public int X; public int Y; public Point(int x, int
2011-01-10 16:14:00
757
转载 读取RSS源
<br /> protected void GetFeed_Click(object sender, EventArgs e)<br /> {<br /> if (FeedUrl.Text == "")<br /> {<br /> RssFeed.Text = "信息不能为空!";<br /> return;<br /> }<br /> RssFeed.Text = Load(FeedUrl.Te
2010-08-18 23:03:00
368
原创 实现网站的RSS应用
<br /> 文件加载代码<br /> string xmlDoc = "rss.xml";<br /> protected void Page_Load(object sender, EventArgs e)<br /> {<br /> xmlDoc = Server.MapPath(".") + xmlDoc;<br /> GetRSS();<br /> XmlDocument doc = new XmlDocument();<br />
2010-08-18 20:38:00
359
原创 创建XML文档
<br />XmlDocument 表示xml文档<br />XmlNode 表示xml文档中的单个节点<br />XmlText 表示元素或属性的文本内容<br />XmlComment 表示xml的注释内容<br />XmlElement 构成xml文档的最小单位,即表示单个的数据<name>Tom</name><br />XmlAttribute 属性与子元素有些重叠<br />XmlDelclaration xml文档第一行必须使用声明<?xml version="1.0"?><br /> <br
2010-08-15 21:26:00
335
原创 JS小练习-电子邮件地址验证
<br /><script language="javascript" type="text/javascript"><br />function checkEmail() {<br /> var email=document.form.email.value;<br /> if(email.length==0){<br /> alert("不能为空!");<br /> return false;<br /> } else if(email.indexOf("@",0)==-1){<br /> ale
2010-08-01 21:26:00
903
原创 JS小练习
<br /><a href="javascript:histoty.go(-1)">后退</a> <a href="javascript:histoty.go(-1)">前进</a> <a href="javascript:location.reload()">刷新</a> <br /> <select id="Select1" onchange="javascript:location=this.value"><br /> <option value="JS1.htm">JS练习1</
2010-07-31 08:13:00
581
2
原创 javascript小练习
<br /><%@ Page Language="C#" AutoEventWireup="true" CodeFile="T3.aspx.cs" Inherits="T3" %><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/19
2010-07-30 16:32:00
487
9
原创 javascript小练习
<br /><%@ Page Language="C#" AutoEventWireup="true" CodeFile="T3.aspx.cs" Inherits="T3" %><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/19
2010-07-30 16:28:00
357
转载 w3school在线测试工具 v1.2
<br />w3school在线测试工具 v1.2<br />http://www.w3school.com.cn/tiy/t.asp?f=jseg_text
2010-07-30 11:24:00
934
原创 抓取页面源代码
<br /> private string GetPageCodes(string Url)<br /> {<br /> string strHtml = "";<br /> WebRequest web = WebRequest.Create(Url);<br /> //WebResponse hwr = web.GetResponse();<br /> HttpWebResponse hwr = (HttpWebResponse)web
2010-06-23 17:45:00
401
原创 PingIP地址
<br />using System;<br />using System.Collections.Generic;<br />using System.ComponentModel;<br />using System.Data;<br />using System.Drawing;<br />using System.Text;<br />using System.Windows.Forms;<br />using System.Net;<br />using System.Net.NetworkInf
2010-06-17 17:05:00
726
原创 遍历所有路径
//遍历文件夹 string path = @"d:/2008"; string[] dir = Directory.GetDirectories(path); foreach (string str in dir) { Console.WriteLine(str+"");
2010-05-23 08:04:00
606
原创 GridView鼠标移过变色
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onmouseover","th
2010-05-17 16:24:00
310
原创 多文件上传
//该方法用于添加一个上传文件的控件 private void InsertC() { //实例化ArrayList ArrayList AL = new ArrayList(); this.F.Rows.Clear(); //清除id为F表格里的所有行 GetInfo(); //表示 HtmlTable 控
2010-05-07 15:38:00
306
原创 优化程序该注意的
逻辑层中的代码: /// /// 将包含用户数据的DataRow转换成实体类 /// /// 包含用户数据的DataRow /// 包含用户数据的DataRow对应的实体类 private static UserInfo ChangeToEntity(DataRow row)
2010-05-06 22:40:00
277
转载 经典SQLSERVER语句
下列语句部分是Mssql语句,不可以在access中使用。 SQL分类: DDL—数据定义语言(CREATE,ALTER,DROP,DECLARE) DML—数据操纵语言(SELECT,DELETE,UPDATE,INSERT) DCL—数据控制语言(GRANT,REVOKE,COMMIT,ROLLBACK) 首先,简要介绍基础语句: 1、说明:创建数
2010-05-03 22:52:00
785
转载 MVC的优缺点
优点: ◆低耦合性。视图层和业务层分离,这样就允许更改视图层代码而不用重新编译模型和控制器代码,同样,一个应用的业务流程或者业务规则的改变只需要改动MVC的模型层即可。因为模型与控制器和视图相分离,所以很容易改变应用程序的数据层和业务规则。 ◆高重用性和可适用性。随着技术的不断进步,现在需要用越来越多的方式来访问应用程序。MVC模式允许你使用各种不同样
2010-05-03 22:34:00
604
原创 数据库通用类DBHelper
using System;using System.Configuration;using System.Data;using System.Data.SqlClient;using System.Collections;namespace DAL{ /// /// SqlHelper 类是对 SqlClient 类的再次封装 ///
2010-05-03 22:00:00
1441
1
转载 asp.net下的fckeditor配置及优化
asp.net下的fckeditor配置及优化 1、下载文件 http://www.fckeditor.net/downloadFCKeditor_2.4.1.zip 和 FCKeditor.Net_2.2.zip这是目前最新的版本。 FCKeditor_2.4.1.zip 为fckeditor的页面文件 FCKeditor.Net_2.2.zip 是asp.net下的上传用的
2010-04-30 16:54:00
362
1
原创 图片上传
if (FileUpload1.HasFile) { string Type = Path.GetExtension(FileUpload1.FileName).ToString();//获取文件后缀名 string type = Type.ToLower(); if (type == ".jpg" |
2010-04-30 11:41:00
570
原创 CheckBoxList取值
for(int i=0;i{ if(this.CheckBoxList1.Items[i].Selected) { Label1.Text+=this.CheckBoxList1.Items[i].Text+""; }}
2010-04-29 21:16:00
411
转载 JS脚本调用类
/// /// 一些常用的Js调用 /// 添加新版说明:由于旧版普遍采用Response.Write(string msg)的方式输出js脚本,这种 /// 方式输出的js脚本会在html元素的<html></html>标签之外,破坏了整个xhtml的结构, /// 而新版本则采用ClientScript.RegisterSta
2010-04-26 21:59:00
1418
转载 生成静态页类
/// /// HTML静态页面生成类 /// public class HtmlPager { private static string htmlPath = HttpContext.Current.Server.MapPath("~/html/"); private static string template;
2010-04-26 21:52:00
334
转载 启用IIS Gzip 页面压缩技术 加速网页的浏览速度
启用Gzip压缩是在Web服务器和浏览器间传输压缩文本内容的方法。Gzip压缩采用通用的压缩算法压缩HTML、JavaScript、CSS等静态文件和asp、aspx、php、jsp等动态文件。压缩的最大好处就是降低了网络传输的数据量,从而提高客户端浏览器的访问速度。当然,同时也会增加一点点服务器的负担。通过Windows2003系统设置的方式启用Gzip的突出优点就是效率较高,所以我们直接设置I
2010-04-26 15:43:00
371
原创 ASP.NET静态页生成技术
using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using
2010-04-25 11:46:00
267
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人