¼ÇµÃÔÚ½¨Á¢Ò»¸öÎļþ¼Ð"updata"
saveannounce_upload.asp ÉÏ´«Ò³
------------------------------------
<html>
<head>
<style type="text/css
">
body {font-size:9pt;}
input {font-size:9pt;}
</style>
<title>ÎļþÉÏ´«</title>
</head>
<body>
<form name="form" method="post" action="saveannouce_upfile.asp" enctype="multipart/form-data" >
Îļþ
<input type="file" name="file1" size=10>
<input type="submit" name="Submit" value="ÉÏ´«">
</form>
</body>
</html>
------------------------------------
saveannouce_upfile.asp ±£´æÎļþµ½·þÎñÆ÷
------------------------------------
<!--#include FILE="upload.inc"-->
<html>
<head>
<title>ÎļþÉÏ´«</title>
</head>
<body>
<%
dim upload,file,formName,formPath
set upl ......
Îļþ1.ÉÏ´«½çÃæÎļþ upload.htm
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>ÎļþÉÏ´«</title>
</head>
<body>
<form method="POST" action="SaveFile.asp">
ÎļþÉÏ´«£º<input type="file" name="file" size="42"> <input type="submit" value="Ìá½»" name="bb">
</form>
</body>
</html>
Îļþ2.±£´æÉÏ´«Îļþ SaveFile.asp
<%
dim file,filename,houzui
file = Request.Form("file")
if file="" then
response.write"<script>alert('ÇëÑ¡ÔñÒªÉÏ´«µÄÎļþ£¡');window.location.href='upload.htm';</script>"
else
houzui=mid(file,InStrRev(file, "."))
if houzui=".gif" or houzui=".jp ......
CREATE PROCEDURE sp_newpage
@tb varchar(50), --±íÃû
@col varchar(50), --°´¸ÃÁÐÀ´½øÐзÖÒ³
@coltype int, --@colÁеÄÀàÐÍ,0-Êý×ÖÀàÐÍ,1-×Ö·ûÀàÐÍ,2-ÈÕÆÚʱ¼äÀàÐÍ
@orderby bit, --ÅÅÐò,0-˳Ðò,1-µ¹Ðò
@collist varchar(800),--Òª²éѯ³öµÄ×Ö¶ÎÁбí,*±íʾȫ²¿×Ö¶Î
@pagesize int, --ÿҳ¼Ç¼Êý
@page int, --Ö¸¶¨Ò³
@condition varchar(800),--²éѯÌõ¼þ
@RecordCount Int Output,
@pages int OUTPUT --×ÜÒ³Êý
AS
/*
¹¦ÄÜÃèÊö£º¶ÔÖ¸¶¨±íÖÐÂú×ãÌõ¼þµÄ¼Ç¼°´Ö¸¶¨ÁнøÐзÖÒ³²éѯ£¬·ÖÒ³¿ÉÒÔ˳Ðò¡¢µ¹Ðò
²éѯ¿ÉÒÔÖ¸¶¨Ò³´óС¡¢Ö¸¶¨²éѯÈÎÒâÒ³¡¢Ö¸¶¨Êä³ö×Ö¶ÎÁÐ±í£¬·µ»Ø×ÜÒ³Êý
×÷ Õߣºpbsql
°æ ±¾£º1.10
×îºóÐ޸ģº2004-11-29
*/
DECLARE @sql nvarchar(4000),@where1 varchar(800),@where2 varchar(800)
IF @condition is null or rtrim(@condition)=''
BEGIN--ûÓвéѯÌõ¼þ
SET @where1=' WHERE '
SET @where2=' '
END
ELSE
BEGIN- ......
·½·¨Ò» : ½ûÓÃHTML
×î¼òµ¥µÄ·½·¨ÊÇÖ±½Ó½ûÓÃhtml±êÇ©¶ø²»ÓÃÒƳýËüÃÇ. ¿ÉÒÔʹÓÃReplace()º¯Êý. ÀýÈç:
strText = Replace(strText, "<script", "<script", 1, -1, 1)
»òÕßÖ±½Ó½ûÓÃËùÓеÄhtml:
strText = Replace(strText, "<", "<")
ÕâÑù×öËäÈ»ºÜ°²È«,µ«ÏԵò»¹»ÓѺÃ.(Óû§Ìá½»µÄÎı¾»á±äµÃÄÑÒÔÔĶÁ)
·½·¨¶þ: ʹÓÃ"<"ºÍ">"
ÔõÑùʹµÃhtml±êÇ©´ÓÎı¾ÖÐÏûʧÄØ? ÎÒÃÇ¿ÉÒÔÈ¥µô"<"ºÍ">"ÖмäµÄËùÓÐÄÚÈÝ
ÔÚJavaScriptÖÐÕâºÜ¼òµ¥:
function RemoveHTML( strText )
{
var regEx = /<[^>]*>/g;
return strText.replace(regEx, "");
}
ÏÖÔڻص½VBScript, ¶ÔÓÚScriptingÒýÇæ5.0»ò¸ü¸ß°æ±¾(¿ÉÒÔͨ¹ýµ÷ÓÃScriptEngineMajorVersionºÍScriptEngineMinorVersionº¯ÊýÀ´¼ìÑé°æ±¾),ÎÒÃÇÒ²¿ÉÒÔʹÓÃRegExpÎïÌå:
Function RemoveHTML( strText )
Dim RegEx
Set RegEx = New RegExp
RegEx.Pattern = "<[^>]*>"
RegEx.Global = True
Rem ......
Ö»ÄÜÊäÈë1¸öÊý×Ö
±í´ïʽ ^\d$
ÃèÊö Æ¥ÅäÒ»¸öÊý×Ö
Æ¥ÅäµÄÀý×Ó 0,1,2,3
²»Æ¥ÅäµÄÀý×Ó
Ö»ÄÜÊäÈën¸öÊý×Ö
±í´ïʽ ^\d{n}$ ÀýÈç^\d{8}$
ÃèÊö Æ¥Åä8¸öÊý×Ö
Æ¥ÅäµÄÀý×Ó 12345678,22223334,12344321
²»Æ¥ÅäµÄÀý×Ó
Ö»ÄÜÊäÈëÖÁÉÙn¸öÊý×Ö
±í´ïʽ ^\d{n,}$ ÀýÈç^\d{8,}$
ÃèÊö Æ¥Åä×îÉÙn¸öÊý×Ö
Æ¥ÅäµÄÀý×Ó 12345678,123456789,12344321
²»Æ¥ÅäµÄÀý×Ó
Ö»ÄÜÊäÈëmµ½n¸öÊý×Ö
±í´ïʽ ^\d{m,n}$ ÀýÈç^\d{7,8}$
ÃèÊö Æ¥Åämµ½n¸öÊý×Ö
Æ¥ÅäµÄÀý×Ó 12345678,1234567
²»Æ¥ÅäµÄÀý×Ó 123456,123456789
Ö»ÄÜÊäÈëÊý×Ö
±í´ïʽ ^[0-9]*$
ÃèÊö Æ¥ÅäÈÎÒâ¸öÊý×Ö
Æ¥ÅäµÄÀý×Ó 12345678,1234567
²»Æ¥ÅäµÄÀý×Ó E,ÇåÇåÔ¶ù
Ö»ÄÜÊäÈëij¸öÇø¼äÊý×Ö
±í´ïʽ ^[12-15]$
ÃèÊö Æ¥Åäij¸öÇø¼äµÄÊý×Ö
Æ¥ÅäµÄÀý×Ó 12,13,14,15
²»Æ¥ÅäµÄÀý×Ó
Ö»ÄÜÊäÈë0ºÍ·Ç0´òÍ·µÄÊý×Ö
±í´ïʽ ^(0|[1-9][0-9]*)$
ÃèÊö ¿ÉÒÔΪ0£¬µÚÒ»¸öÊý×Ö²»ÄÜΪ0£¬Êý×ÖÖпÉÒÔÓÐ0
Æ¥ÅäµÄÀý×Ó 12,10,101,100
²»Æ¥ÅäµÄÀý×Ó 01,ÇåÇåÔ¶ù
Ö»ÄÜÊäÈëʵÊý
±í´ïʽ ^[-+]?\d+(\.\d+)?$
ÃèÊö Æ¥Åäʵ ......
×î½ü¼¸ÖÜ£¬ÔÚ²©¿Í¡¢TwitterºÍÂÛ̳ÉÏÈç»ðÈçݱµØÕ¹¿ªÁËÒ»³¡ÌÖÂÛ¡£ÌÖÂÛµÄÄÚÈÝÊÇ£º¿ª·¢ÈËÔ±ÊÇ·ñÓ¦¸ÃʹÓûòѧϰASP.NET MVC¡£´Ó“²»ÍƼöѧϰ”µ½“ËùÓÐASP.NET¿ª·¢ÈËÔ±¶¼Ó¦¸Ãѧϰ”£¬¸÷ÖÖ²»Í¬µÄ¹Ûµã²ã³ö²»Çî¡£InfoQ¶ÔÆäÖв¿·ÖÌÖÂÛÄÚÈݽøÐÐÁË×ܽᡣ
Rob Conerey£¨SubSonicÖ®¸¸£¬Ä¿Ç°ÊÇ΢ÈíASP.NET MVCÍŶӵÄÒ»Ô±£©½âÊÍÁËΪʲô¿ª·¢ÈËÔ±Ó¦¸ÃѧϰASP.NET MVC¡£ÔÚÎÄÕµĿªÊ¼£¬Ëû³ÆWebFormsÊÇÒ»¸ö“¾Þ´óµÄ»ÑÑÔ”¡£
WebFormsÊǸö»ÑÑÔ£¬ËüÊÇÒ»¸ö±»ÖÖÖÖ»ÑÑÔºÍÆÛÆËù°üΧ×ŵijéÏó»úÖÆ¡£Äã¶ÔWebFormsËù×öµÄÒ»Çж¼ÓëWebÎÞ¹Ø £ Ëü°ïÄã×öÁ˱¾¸ÃÄã×Ô¼º×öµÄÊ¡£
ÅóÓÑÃÇ£¬Õâ¿ÉÊǼþ´óÊ£¨ÖÁÉÙ¶ÔÎÒÀ´Ëµ£©£ºÄ㹤×÷ÔÚ»ÑÑÔÖС£WebÊÇ“Îޔ״̬µÄ£¬ËüÒÀÀµÒ»ÖÖ½Ð×öHTMLµÄ¶«Î÷£¬²¢Ê¹ÓÃÁíÒ»ÖÖ½Ð×öHTTPµÄ¶«Î÷ͨ¹ýµçÀ½«HTML·¢À´·¢È¥£ÄãÐèÒªÁ˽âËü¡¢ÈÈ°®Ëü²¢ÔÚ¹Ç×ÓÀï¸ÐÊÜËü¡£
RobÁоÙÁË7¸öʹÓÃASP.NET MVCµÄÀíÓÉ£¬»òÕßÓÃËûµÄ»°Ëµ“±ÜÃâ±»³ÆΪ¹ÖÈ˵Ä7¸öÀíÓÉ”£º
¿É²âÊÔÐÔ
ÍêÈ«¿ØÖÆHTML
¿ÉÀ©Õ¹
´ÙʹÄã˼¿¼
Ò×ÓÚ¿Í»§¶ËJavascript±à³Ì
¿ÉÒÔѧµ½ÐµĶ«Î÷
ÓÐȤ
È»ºó×ܽᵽ£º
½áÂÛ£ºWeb±à³ÌÔÙÒ»´Î³äÂúÁËÀÖȤ£¬ÖÁÉÙ¶ÔÎÒºÍÎÒµÄèÀ´Ëµ¡£µ±È»ÕâÓ ......
×î½ü¼¸ÖÜ£¬ÔÚ²©¿Í¡¢TwitterºÍÂÛ̳ÉÏÈç»ðÈçݱµØÕ¹¿ªÁËÒ»³¡ÌÖÂÛ¡£ÌÖÂÛµÄÄÚÈÝÊÇ£º¿ª·¢ÈËÔ±ÊÇ·ñÓ¦¸ÃʹÓûòѧϰASP.NET MVC¡£´Ó“²»ÍƼöѧϰ”µ½“ËùÓÐASP.NET¿ª·¢ÈËÔ±¶¼Ó¦¸Ãѧϰ”£¬¸÷ÖÖ²»Í¬µÄ¹Ûµã²ã³ö²»Çî¡£InfoQ¶ÔÆäÖв¿·ÖÌÖÂÛÄÚÈݽøÐÐÁË×ܽᡣ
Rob Conerey£¨SubSonicÖ®¸¸£¬Ä¿Ç°ÊÇ΢ÈíASP.NET MVCÍŶӵÄÒ»Ô±£©½âÊÍÁËΪʲô¿ª·¢ÈËÔ±Ó¦¸ÃѧϰASP.NET MVC¡£ÔÚÎÄÕµĿªÊ¼£¬Ëû³ÆWebFormsÊÇÒ»¸ö“¾Þ´óµÄ»ÑÑÔ”¡£
WebFormsÊǸö»ÑÑÔ£¬ËüÊÇÒ»¸ö±»ÖÖÖÖ»ÑÑÔºÍÆÛÆËù°üΧ×ŵijéÏó»úÖÆ¡£Äã¶ÔWebFormsËù×öµÄÒ»Çж¼ÓëWebÎÞ¹Ø £ Ëü°ïÄã×öÁ˱¾¸ÃÄã×Ô¼º×öµÄÊ¡£
ÅóÓÑÃÇ£¬Õâ¿ÉÊǼþ´óÊ£¨ÖÁÉÙ¶ÔÎÒÀ´Ëµ£©£ºÄ㹤×÷ÔÚ»ÑÑÔÖС£WebÊÇ“Îޔ״̬µÄ£¬ËüÒÀÀµÒ»ÖÖ½Ð×öHTMLµÄ¶«Î÷£¬²¢Ê¹ÓÃÁíÒ»ÖÖ½Ð×öHTTPµÄ¶«Î÷ͨ¹ýµçÀ½«HTML·¢À´·¢È¥£ÄãÐèÒªÁ˽âËü¡¢ÈÈ°®Ëü²¢ÔÚ¹Ç×ÓÀï¸ÐÊÜËü¡£
RobÁоÙÁË7¸öʹÓÃASP.NET MVCµÄÀíÓÉ£¬»òÕßÓÃËûµÄ»°Ëµ“±ÜÃâ±»³ÆΪ¹ÖÈ˵Ä7¸öÀíÓÉ”£º
¿É²âÊÔÐÔ
ÍêÈ«¿ØÖÆHTML
¿ÉÀ©Õ¹
´ÙʹÄã˼¿¼
Ò×ÓÚ¿Í»§¶ËJavascript±à³Ì
¿ÉÒÔѧµ½ÐµĶ«Î÷
ÓÐȤ
È»ºó×ܽᵽ£º
½áÂÛ£ºWeb±à³ÌÔÙÒ»´Î³äÂúÁËÀÖȤ£¬ÖÁÉÙ¶ÔÎÒºÍÎÒµÄèÀ´Ëµ¡£µ±È»ÕâÓ ......