.net框架下的MD5
摘要:c#示例 public string md5(string str,int code) { if(code==16) //16位MD5加密(取32位加密的9~25字符) { return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str,"MD5").ToLower().Substring(...
阅读全文
posted @
2007-03-08 00:21
mbskys
阅读(138)
推荐(0)
ASP.NET生成随机验证码
摘要://产生随机字符串private string GenCode(intnum){string[]source={"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","
阅读全文
posted @
2007-03-08 00:20
mbskys
阅读(94)
推荐(0)
正则表达式学习日记
摘要:1、“.”为通配符,表示任何一个字符,例如:“a.c”可以匹配“anc”、“abc”、“acc”;2、“[]”,在[]内可以指定要求匹配的字符,例如:“a[nbc]c”可以匹配“anc”、“abc”、“acc”;但不可以匹配“ancc”,a到z可以写成[a-z],0到9可以写成[0-9];3、数量限定符号,表示匹配次数(或者叫做长度)的符号:包括:“*”——0次或者多次“+”——1次或者多次“?”...
阅读全文
posted @
2007-03-08 00:17
mbskys
阅读(72)
推荐(0)
Asp.net取得页面执行时间的代码
摘要:取得页面执行时间的代码在Global.asax.cs文件中protected void Application_BeginRequest(Object sender, EventArgs e){Application["StartTime"] = System.DateTime.Now;}protected void Application_EndRequest(Object sender, Ev...
阅读全文
posted @
2007-03-08 00:17
mbskys
阅读(86)
推荐(0)
Web Services的身份验证
摘要:一 引言随着Web Service的出现,其应用也是越来越广,同时也深受开发者的喜爱。下面我将引用一个实际应用例子说明本文的目的。假设有一个网上购物系统LiveShopping。在LiveShopping上,当客户已经选好他自己想买的商品之后,接下来就该付帐了。LiveShopping可以直接用信用卡付帐。另外假设LiveShopping的电子付款是与VeriSign合作。也就是说LiveShop...
阅读全文
posted @
2007-03-08 00:16
mbskys
阅读(152)
推荐(0)
海量数据库的查询优化及分页算法方案
摘要:(一)深入浅出理解索引结构 实际上,您可以把索引理解为一种特殊的目录。微软的SQL SERVER提供了两种索引:聚集索引(clustered index,也称聚类索引、簇集索引)和非聚集索引(nonclustered index,也称非聚类索引、非簇集索引)。下面,我们举例来说明一下聚集索引和非聚集索引的区别: 其实,我们的汉语字典的正文本身就是一个聚集索引。比如,我们要查“安”字,就会很自然...
阅读全文
posted @
2007-03-08 00:16
mbskys
阅读(148)
推荐(0)
采集抓取spider正则表达式Url
摘要:using System;using System.Net;using System.Text;using System.Text.RegularExpressions;namespace HttpGet{class Class1{[STAThread]static void Main(string[] args){System.Net.WebClient client = new WebClie...
阅读全文
posted @
2007-03-08 00:15
mbskys
阅读(198)
推荐(0)
C#多线程应用技术面对面探讨
摘要:实例程序说明 本文的实例程序包括一个列表框、三个按钮。程序使用一个新的线程来运行一个后台处理,结果在列表框中显示。按钮button1启动一个计算平方的线程。按钮button2停止后台处理线程。按钮button3退出程序。程序运行情况如图1所示。 [img]attachments/month_0606/02170216c02f_20060518105002252.jpg[/img] 使用线程 ...
阅读全文
posted @
2007-03-08 00:10
mbskys
阅读(136)
推荐(0)
抓取合租信息代码
摘要:textBox1.Text = "";listBox1.Items.Clear();DataSet ds = new DataSet();DLFcWebService.Service s = new DlfcSpider.DLFcWebService.Service();#region 取列表try{s.Bot_List(ref ds, chk);//MessageBox.Show(ds.Tabl...
阅读全文
posted @
2007-03-08 00:09
mbskys
阅读(171)
推荐(0)
net中的验证码源码
摘要:.net中的验证码源码 文章来源: 视点设计 8see.net http://blog.8see.net/这个是页面的后台代码,只要建立好前台页面后把下面的代码拷贝过去就行了在需要调用验证码的地方用下面这样的代码调用就行了using System;using System.Collections;using System.ComponentModel;using System.Data;using...
阅读全文
posted @
2007-03-08 00:08
mbskys
阅读(148)
推荐(0)
正则表达式从HTML中提取文本内容
摘要:using System;using System.Collections.Generic;using System.Text;using System.Text.RegularExpressions;namespace Utility{public class HtmlUtil{public static string StripHTML(string strHtml){//All the re...
阅读全文
posted @
2007-03-08 00:07
mbskys
阅读(1799)
推荐(0)
sql server DateTime转换
摘要:select CONVERT(varchar, getdate(), 120 )2004-09-12 11:06:08select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')20040912110608select CONVERT(varchar(12) , getdate(),...
阅读全文
posted @
2007-03-08 00:06
mbskys
阅读(207)
推荐(0)
图片加水印类
摘要:[down=attachments/month_0606/06143356rogv_waterMark.rar>点击下载此文件[/down]using System;using System.Drawing;using System.Drawing.Imaging;using System.IO;using System.Drawing.Drawing2D;namespace KuKu{publi...
阅读全文
posted @
2007-03-08 00:04
mbskys
阅读(203)
推荐(0)
一个文件上传的类
摘要:namespace Wmj{public class MyUpload{private System.Web.HttpPostedFile postedFile=null;private string savePath="";private string extension="";private int fileLength=0;//显示该组件使用的参数信息public string Help{g...
阅读全文
posted @
2007-03-08 00:02
mbskys
阅读(101)
推荐(0)
ASP.NET应用程序设计的10大技巧
摘要:在本篇文章中,我们将讨论编程人员在使用ASP.NET开发应用程序时需要注意的10个技巧,这些技巧涉及从缺省的控件、表单名的改变到StringBuilder类的使用,有助于编程人员能够尽快地适应.NET环境。 1、在使用Visual Studio .NET时,除直接或非引用的对象外,不要使用缺省的名字 .NET带来的好处之一是所有的源代码和配置文件都是纯文本文件,能够使用Notepad或W...
阅读全文
posted @
2007-03-08 00:01
mbskys
阅读(132)
推荐(0)
利用WebClient和WebRequest类获得网页源代码
摘要:http://workgroup.cn/CS/blogs/aspnet/archive/2006/07/07/_29522875_WebClient_8C54_WebRequest_7B7CB783975F517F7598906EE34E0178_.aspx利用.NET框架提供的 WebClient类 和 WebRequest类,我们可以很轻易地得到给定URL地址的源代码,很简单,以下是C#的完整...
阅读全文
posted @
2007-03-08 00:00
mbskys
阅读(153)
推荐(0)
更改ASP.NET问参的值,也就是QueryString
摘要:今天编程无意间用到的。就写了一个函数。也不知道有没有其它的方法。 /// /// 在当前QueryString更改某些字符串的设置 /// /// 要更改的键值 /// 对应的值 /// private string SetQueryString(string Key,string Value) { NameValueCollection Name=new NameVal...
阅读全文
posted @
2007-03-07 23:57
mbskys
阅读(139)
推荐(0)
网页间非常规方法传递值的方法
摘要:动态网页间如何把一个值从一个网页传递到另一个网页上呢 通常有这么种a. http://localhost/test.aspx?name=[你要传的值] b. 用form 的submit() 指定target c. cookies d. Session asp.net中借用Page类的静态全局也算是一种 a.比较灵活但有255个字符的限制,并且传中文可能会存在编码上的问题(这个以后和大家讨论)。 c...
阅读全文
posted @
2007-03-07 23:54
mbskys
阅读(96)
推荐(0)
把UTF-8编码转换为GB2312编码
摘要:最近在做的广告系统中,碰到了一个问题,广告系统采用的UTF-8编码,而一些使用这套广告系统的频道页面使用的是GB2312编码。当然也有使用UTF-8编码的频道使用这套广告系统。 频道页面是通过嵌入类似如下的代码方式,来调用广告的。具体那个时间显示那个广告,或者那些广告组合是广告系统自己处理的。 不同编码的页面、脚本之间互相引用,就会产生乱码的问题,解决方法就是统一成一种编码。asp.net...
阅读全文
posted @
2007-03-07 23:54
mbskys
阅读(3334)
推荐(0)
用浏览器来接收C# 的程序返回的时间cool!
摘要:http://www.yaosansi.com/blog/article.asp?id=352 using System;using System.Collections;using System.IO;using System.Net;using System.Net.Sockets;using System.Threading;class HttpProcessor {private Sock...
阅读全文
posted @
2007-03-07 23:51
mbskys
阅读(123)
推荐(0)