ASP VB.NET ÏÂÔØ·þÎñÆ÷Îļþµ½¿Í»§¶Ë
Try
Dim Path As String = Server.MapPath("~/Download/") 'Îļþ·¾¶
Path = Path & "file.txt" 'ÎļþµÄÃû³Æ
If Not System.IO.File.Exists(Path) Then
‘Èç¹ûÎļþ²»´æÔÚ
Exit Sub
Else
Response.ContentType = "application/x-zip-compressed"
Response.AddHeader("Content-Disposition", "attachment;filename=" + Server.UrlPathEncode(Path))
Response.TransmitFile(Path)
End If
Catch ex As Exception
'ÎļþÏÂÔØʧ°Ü£¡
End Try
Ïà¹ØÎĵµ£º
<%
set rs=server.createobject("adodb.recordset")
sql="select * from YONGHU where (ID is null)"
rs.open sql,conn,1,3
rs.addnew
rs("USERNAME")=request("username")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
session("username")=rs("name")
respo ......
4.1 ³£ÓõÄHTML¿Ø¼þ
4.1.1 ±íµ¥¿Ø¼þ
ÓÃÓÚ½ÓÊÕ¿Í»§¶ËµÄÊäÈ룬²¢½«ÊäÈëµÄ½á¹ûÌá½»¸ø·þÎñÆ÷´¦Àí
1.HtmlForm¿Ø¼þ
ËùÓеÄWeb Form¿Ø¼þ±ØÐë°üº¬ÔÚÒ»¶ÔHtmlForm¿Ø¼þ±êÇ©ÖÐ
<Form
Id = "¿Ø¼þ±êʶ"
Runat = "Server"
Method = "Post | Get"
Action = "ÒªÖ´ÐÐ ......
Õ⼸ÌìÒ»Ö±ÔÚ×öÒ»¸öСµÄ¹¤³Ì,×öÒ»¸öÎı¾ÔĶÁÆ÷,ÏÖÔÚ×öµÄÒѾÓÐÈý·ÖÖ®¶þÁË,´ÓÖÐѧϰµ½Á˺ܶà,¶ÔÎÒÃÇÒÔǰѧϰµÄ³É¹ûÓÐÁ˸üÉî¿ÌµÄÀí½â.
VBÊÇÒ»ÃÅÃæÏò¶ÔÏóµÄ³ÌÐòÉè¼Æ,ÎҾʹÓÃæÐÔ¶ÔÏóµÄ½Ç¶È¶ÔËû×öÒ»´Î×ܽá
°ÑVBÖÐËùÓеÄÊý¾Ý,±äÁ¿,¿Ø¼þ¶¼¿´×öÒ»¸ö¶ÔÏó
ÎÒÃÇËùÓеIJÙ×÷¶¼ÊǶԶÔÏóµÄ²Ù×÷,ÈöÔÏóÈ¥Ö´ÐÐijһ¸ö¹¦ÄÜ
´ó¼ÒÏÈ¿´Ò»¸öÀý× ......
<%
dim db
set db=Server.CreateObject("Adodb.Connection")
db.Open "Driver={Microsoft Access Driver (*.mdb)};Dbq=" & Server.Mappath("../mdb/count.mdb")
dim strSql,rs,visitNum
strSql="Select visitNum from counter "
SET rs=db.Execute(strSql)
if session("agai ......
VBSÀ³¬³öIntegerÀàÐ͵ÄÈ¡Öµ·¶Î§£¬¸ÃÀàÐ͵ÄÈ¡Öµ·¶Î§Îª-32,768 µ½ 32,767 Ö®¼äµÄÕûÊý¡£
³ö´íµÄ¸ùÔ´£º
ÔÚASPÀÓÐʱºòΪÁË·ÂÖ¹×¢È룬ËùÒÔÔÚ½ÓÊÕ²ÎÊýµÄʱºòÖ±½ÓʹÓÃCintº¯Êý°Ñ½Ó¹ýÀ´µÄ²ÎÊýת»»ÎªInteger£¨Êý×Ö£©ÀàÐÍ£¬Õâ¾Í´æÔÚÒ»¸öDZÔÚÎÊÌ⣬µ±Ò³Ãæ½ÓÊÕµÄij¸ö²ÎÊý£¨Request("xxx")£©³¬¹ýÈ¡Öµ·¶Î§Ê±£¨¿É¼òµ¥Àí½âΪ5λÊý×Ö£ ......