Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

AspÖÐÒþ²ØÏÂÔØµØÖ·

<%
Response.Buffer = true
Response.Clear
dim url
Dim fso,fl,flsize
dim Dname
Dim objStream,ContentType,flName,isre,url1
Dim strFileName
strFileName=replace(replace(Request("file"),"\",""),"/","")  '´«²Î
strFileName="/files/"&strFileName    ' ¸Ä³ÉÄãÄãÎļþµÄ´æ·Å·¾¶
If strFileName<>"" Then
'******************************ÏÂÔØÎļþ´æ·ÅµÄ·þÎñ¶ËĿ¼
url=Server.MapPath(strFileName)
else
    Response.Write("no found")
    Response.end 
End If
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set fl=fso.getfile(url)
flsize=fl.size
flName=fl.name
Set fl=Nothing
Set fso=Nothing
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = 1
objStream.LoadfromFile url
Select Case lcase(Right(flName, 4))
Case ".asf"
ContentType = "video/x-ms-asf"
Case ".avi"
ContentType = "video/avi"
Case ".doc"
ContentType = "application/msword"
Case ".zip"
ContentType = "application/zip"
Case ".xls"
ContentType = "application/vnd.ms-excel"
Case ".gif"
ContentType = "image/gif"
Case ".jpg", "jpeg"
ContentType = "image/jpeg"
Case ".bmp"
ContentType = "image/bmp"
Case ".ppt"
ContentType = "application/vnd.ms-powerpoint"
Case ".mdb"
ContentType = "application/x-msaccess"
Case ".wav"
ContentType = "audio/wav"
Case ".mp3"
ContentType = "audio/mpeg3"
Case ".mpg", "mpeg"
ContentType = "video/mpeg"
Case ".rtf"
ContentType = "application/rtf"
Case ".htm", "html" ,"htm(1)"
ContentType = "text/html"
Case ".txt"
ContentType = "text/plain"
Case Else
ContentType = "application/octet-stream"
End Select
'  ÎÒÊÇÓÃUPload×é¼þÉÏ´«µÄ,Èç¹ûÖØÃû»á²úÉú"(Êý×Ö)" ºó׺,
'  ÓÐЩÖ÷»ú»á×èÖ¹ÏÂÔØÕâÀàÎļþ,ËùÒÔÕâÀï¼ÓÒ»¸ö¼ì²é,½«Upload×é¼þ×Ô¶¯Éú³ÉµÄºó׺
If InStr(lcase(Right(flName, 1)),")") Then
 flName=mid(flName,1,Len(flName)-3)
End If
Response.AddHeader "Content-Disposition", "attachment; filename=" &


Ïà¹ØÎĵµ£º

ÔÚaspÑéÖ¤ÂëÖÐhead.fixºÍbody.fix

fixÊÇbmpµÄÒ»ÖÖÑÜÉú¸ñʽ£¬¿ÉÓÃÓÚaspÉú³ÉÑéÖ¤ÂëͼÐΡ£
Ò»¸öÀý×Ó£º
1 ͼÏó»æÖÆÍê³Éºó£¬½«Îļþ´æÎª24λλͼ¸ñʽµÄBMPͼÏóÎļþ¡£
2 È¥³ýǰ54ByteÄÚÈÝ.
3 ¸ÄÃûΪBODY+Êý×Ö.FIX
4 ÐÞ¸ÄCHECKCODE.ASP,µ÷ÓÃÄãÐÂ×öµÄÕâ¸öÎļþ.
£¨checkcode.asp ¸ºÔðÉú³ÉºÍÊä³öÑéÖ¤Âë 1309 byte£¬head.fix ÊÇ54byteµÄBMPÍ·£¬body.fix Êý×Ö0~9 10 ......

ASP .NetµÄÓ¦ÓóÌÐòÓò£¨The Application Domain£©

 Ó¦ÓóÌÐòÓòÊÇͨ¹ýCLRÇ¿ÖÆ½ç¶¨µÄÈ·±£Ó¦ÓóÌÐò¼ä²»Ï໥ӰÏìµÄµØÖ·¿Õ¼ä£¬Ëü¾ßÓÐÒÔÏÂÌØÕ÷
 1£®Ò»¸ö¶ÀÁ¢µÄWebÓ¦ÓóÌÐòµÄËùÓÐWebÒ³¹²ÏíÏàͬµÄÄÚ´æ×ÊÔ´£¬ÀýÈçÈ«¾ÖµÄÓ¦ÓóÌÐòÊý¾Ý£¬Ã¿¸öÓû§µÄSessionÊý¾ÝÒÔ¼°»º´æÊý¾Ý¡£ÕâЩÐÅÏ¢²»Äܱ»ÆäËûµÄASP.Net»òASPÓ¦ÓóÌÐòÖ±½Ó·ÃÎÊ¡£
 2£®Ò»¸ö¶ÀÁ¢µÄWebÓ¦ÓóÌÐòËùÓÐWebÒ³¹² ......

ASP.NETÖ®ËÄ——ASP.NET DEV

ÉÏÏÂÎĶÔÏó
===================================
Ò»ÖÖ¶ÔÏó£¬Ëüµ±MTS·þÎñÆ÷×é¼þÔÚÒ»¸ö»î¶¯ÖÐÔËÐÐʱ¸ú×Ù¸Ã×é¼þµÄÊôÐÔ£¬°üÀ¨±»¸ú×Ù×é¼þµÄ¼¤»î״̬¡¢°²È«ÐÅÏ¢¡¢ÊÂÎñ´¦Àí״̬£¨Èç¹û´æÔÚ£©µÈ¡£ÕâÑù¾ÍÃâ³ýÁËÈÃ×é¼þÈ¥¸ú×ÙÆä×ÔÉí״̬¡£
ÉÏÏÂÎĶÔÏóÊÇweb·þÎñÆ÷ÉÏ»ùÓÚwebÓ¦ÓõÄÒ»¸ö±³¾°»·¾³¶ÔÏó£¬ÉÏÏÂÎĶÔÏóÌṩÁËÒ»¸öͬһwebÓ¦Óà ......

aspÏÂÔØÆäËüÍøÕ¾µÄͼƬÀ´¸øhtmlÏÔʾ

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Option Explicit
Response.Buffer = True '»º´æÍ¼Æ¬
Dim objXMLHTTP, XML
Set XML = Server.CreateObject("Microsoft.XMLHTTP") '½¨Á¢ÏÂÔØ¶ÔÏó
XML.Open "GET","http://www.google.cn/images/nav_logo7.png",False '¿ªÊ¼»ñȡͼƬ,http://xxx/pngÕâ½Ú¿ÉÒԸijÉ× ......

ASP.NETÖ®Îå ASP.NET¶ÔÏó

session
===================================
session¶ÔÏóÓÃÓÚ´æ´¢ÌØ¶¨µÄÓû§»á»°ËùÐèµÄÐÅÏ¢ ¡£ Session¶ÔÏóµÄÒýÈëÊÇΪÁËÃÖ²¹HTTPЭÒéµÄ²»×㣬HTTPЭÒéÊÇÒ»ÖÖÎÞ״̬µÄЭÒé¡£
¡¡¡¡SessionÖÐÎÄÊÇ“»á»°”µÄÒâ˼£¬ÔÚASPÖдú±íÁË·þÎñÆ÷Óë¿Í»§¶ËÖ®¼äµÄ“»á»°”¡£SessionµÄ×÷ÓÃʱ¼ä´ÓÓû§µ½´ïij¸öÌØ¶¨µÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ