隐藏文件名后缀的URL Rewrite

青锋幽灵 18年前9月10日 阅读:1330 评论:0


我看网上有很多此类功能,当然asp.net自身很容易实现,但是其它的要实现会出现一点小问题,本人写了一个,经过测试没有任何问题,应该也支持apache。

代码如下:

RewriteRule ^(.*)/([\w\-]+)\?(.*)$ $1/$2\.asp\?$3
RewriteRule ^(.*)/([\w\-]+)$ $1/$2.asp

说明:http://www.x.com/test.asp?a=querystring 可以直接访问 http://www.x.com/test?a=querystring

还有一个省略文件名的正则,代码如下:

RewriteRule ^(.*)/([\w]+)$ $1/index\.asp\?$2

说明:http://www.x.com/index.asp?querystring 可以直接访问 http://www.x.com/querystring

一个简单的Ajax类

青锋幽灵 18年前9月8日 阅读:180 评论:0


/**  
	Powered By CMSDream Copyright © 2007-2008 All rights reserved.  
	14:21 2008-5-10  
**/  
function CMSDreamAjaxLib(){   
	/**//**  
	成员变量  
	*/  
	this.XMLHttpReq = null;		//XML对象   
	this.method = "post";		//执行的方法(post/get)   
	this.url = "";			//异步调用的页面地址   
	this.responseText = "";		//异步返回的响应字符串   
	this.responseXML = "";		//异步返回的响应XM...


如题,目前只对IE,FireFox,Opera这三种浏览器的兼容性进行过测试,其它浏览器还未测试。

有兴趣的朋友可以研究一下,应该也没问题的。

function AttachStyle(styDom, styCss, styId){   
	var istyle = styDom.createElement('style');   
	istyle.setAttribute("type", "text/css");   
	if(styId!=null){if(!document.getElementById(styId)){istyle.setAttribute("id", styId);}}   
	if (istyle.styleSheet){   
		istyle.styleSheet.cssText=styC...

非常好用的Js的querystring类

青锋幽灵 18年前6月7日 阅读:237 评论:0


/**  
	Powered By CMSDream Copyright © 2007-2008 All rights reserved.  
	15:10 2008-6-7  
**/  
function querystring(paramstring){   
	this.url=window.location.href;   
	this.params = new Object();   
	this.initialize = function(){   
		if(paramstring.length == 0) return;   
		if(paramstring.substring(0,1)=='?'){   
			paramstring=paramstring.substring(1);   
		}   
		paramstring = p...

获取字符串长度的函数(ASP/VB/JS)

青锋幽灵 19年前6月7日 阅读:293 评论:0


function strLen(str){      
	var len=0;      
	for(var i=0;i<str.length;i++){      
		var intCode=str.charCodeAt(i);      
		if(intCode>=0 &amp;&amp; intCode<=128){      
			len = len + 1;      
		}else{      
			len = len + 2;      
		}      
	}      
    return len;      
}



Private Function Length(iTxt)   
	Dim txt: txt = Trim(iTxt)   
	Dim x: x = Len(txt)   
...

VB将域名转换成IP地址

青锋幽灵 19年前4月8日 阅读:385 评论:0


Option Explicit   
  
Private Type HOSTENT   
	hName As Long  
	hAliases As Long  
	hAddrType As Integer  
	hLength As Integer  
	hAddrList As Long  
End Type   
  
Private Type WSADATA   
	wversion As Integer  
	wHighVersion As Integer  
	szDescription(0 To 256) As Byte  
	szSystemStatus(0 To 128) As Byte  
	iMaxSockets As Integer  
	iMaxUdpDg As Integer  
	lpszVendorInfo As Long...

VB获取系统运行时间

青锋幽灵 19年前4月5日 阅读:246 评论:0


Private Declare Function GetTickCount&amp; Lib "kernel32" ()   
  
Dim a As Long  
Dim b As Long  
Dim c As Long  
Dim d As Long  
Dim e As Long  
  
Private Sub Form_Load()   
	'   
End Sub  
  
Private Sub Timer1_Timer()   
	a = GetTickCount \ 1000   
	b = GetTickCount \ 1000 \ 60   
	c = GetTickCount \ 1000 \ 60 \ 60   
	d = (a - c * 3600) \ 60   
	e = a - b * 6...


顶部