国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
ASP技巧集錦2

調(diào)用Css做顏色變換:
======================

調(diào)用Css做顏色變換:
======================

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>&Icirc;&THORN;±ê&Igrave;&acirc;&Icirc;&Auml;&micro;&micro;</title>
<style type="text/css">
<!--
.red {
background-color: #FF0000;
}
.blue {
background-color: #0000FF;
}
.yellow {
background-color: #FFFF00;
}
.green {
background-color: #00FF00;
}
.black {
background-color: #000000;
}
.white {
background-color: #FFFFFF;
}
.cyan {
background-color: #00FFFF;
}
.purple {
background-color: #FF00FF;
}
-->
</style>
<script language="javascript">
var timer;
var arrColor = new Array("red","green","yellow","blue","black","white","cyan","purple");
var index1 = 0;
var index2 = 7;
function ChangeColor1()
{
for(var i=0; i<8; i++)
{
if(index1 == 8) index1 = 0;
document.all(‘t‘+(i+1)).className = arrColor[index1];
document.all(‘b‘+(i+1)).innerText = document.all(‘t‘+(i+1)).className;
document.all(‘b‘+(i+1)).style.color = arrColor[index1++];
}
if(index1 == 8) index1 = 0;
index1++;
}
function ChangeColor2()
{
for(var i=8; i>0; i--)
{
if(index2 == 0) index2 = 8;
document.all(‘c‘+i).className = arrColor[--index2];
document.all(‘f‘+i).innerText = document.all(‘c‘+i).className;
document.all(‘f‘+i).style.color = arrColor[index2];
}
if(index2 == 0) index2 = 8;
--index2;
}
</script>
</head>

<body onLoad="setInterval(‘ChangeColor1()‘,500);setInterval(‘ChangeColor2()‘,500);">
<table width="720" border="1" align="center" cellpadding="0" cellspacing="0">
<colgroup>
<col width="12.5%">
<col width="12.5%">
<col width="12.5%">
<col width="12.5%">
<col width="12.5%">
<col width="12.5%">
<col width="12.5%">
<col width="12.5%">
</colgroup>
<tr>
<td id="t1" class="red" height="30"> </td>
<td id="t2" class="green"> </td>
<td id="t3" class="yellow"> </td>
<td id="t4" class="blue"> </td>
<td id="t5" class="black"> </td>
<td id="t6" class="white"> </td>
<td id="t7" class="cyan"> </td>
<td id="t8" class="purple"> </td>
</tr>
<tr style="font-size:10px" align="center">
<td id="b1" height="30"> </td>
<td id="b2"> </td>
<td id="b3"> </td>
<td id="b4"> </td>
<td id="b5"> </td>
<td id="b6"> </td>
<td id="b7"> </td>
<td id="b8"> </td>
</tr>
<tr>
<td colspan="8" height="100"> </td>
</tr>
<tr>
<td id="c1" class="red" height="30"> </td>
<td id="c2" class="green"> </td>
<td id="c3" class="yellow"> </td>
<td id="c4" class="blue"> </td>
<td id="c5" class="black"> </td>
<td id="c6" class="white"> </td>
<td id="c7" class="cyan"> </td>
<td id="c8" class="purple"> </td>
</tr>
<tr style="font-size:10px" align="center">
<td id="f1" height="30"> </td>
<td id="f2"> </td>
<td id="f3"> </td>
<td id="f4"> </td>
<td id="f5"> </td>
<td id="f6"> </td>
<td id="f7"> </td>
<td id="f8"> </td>
</tr>
</table>
</body>
</html>


ASP中怎么運(yùn)行一個服務(wù)器端程序呢
Set WShShell = Server.CreateObject("WScript.Shell")

RetCode = WShShell.Run("d:\xxx.exe", 1, True)

 

‘功能: 過慮HTML字符
‘輸入:字符串
‘輸出:經(jīng)格式化后的字符串
function HTMLEncode(fString)
if not isnull(fString) then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")

fString = Replace(fString, CHR(32)&CHR(32), "  ")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
fString = Replace(fString, CHR(10), "<BR> ")

HTMLEncode = fString
end if
end function

 

‘參數(shù):系統(tǒng)(如:product,article),條件(如果是數(shù)值,則默認(rèn)為categoryID的值),排序,
‘每頁顯示記錄數(shù),模式(more:顯示更多字樣,page:顯示翻頁導(dǎo)航),
‘翻頁導(dǎo)航模式(number:顯示數(shù)字,page:顯示上一頁,下一頁),記錄顯示模版名(顯示記錄的過程名)
class List
dim p_system ‘系統(tǒng)表,如tblProduct,tblArticle
dim p_where ‘條件
dim p_orderBy ‘排序
dim p_recordCount ‘每頁顯示記錄數(shù)
dim p_horizontal ‘每行顯示記錄數(shù)
dim p_mode ‘列表模式,參數(shù):more(更多模式,顯示更多字樣),page(列表模式,顯示翻頁導(dǎo)航)
dim p_moreURL ‘更多模式時的URL
dim p_paginationMode ‘翻頁導(dǎo)航模式,參數(shù):number(數(shù)字導(dǎo)航,顯示如:1,2,3,4),page(翻頁導(dǎo)航,顯示如:上一頁,下一頁)
dim p_models ‘列表模版過程
dim p_table ‘列表的table標(biāo)簽
dim p_page ‘頁碼
dim p_member ‘是否顯示會員產(chǎn)品
dim p_groupWhere

Private Sub Class_Initialize
p_system=""
p_where=""
p_orderBy=" order by categoryID,orderBy,postdate"
p_recordCount=15
p_horizontal=4
p_mode=""
p_moreURL=""
p_paginationMode="page"
p_models=""
p_table="<table width=100% border=0 align=center cellpadding=0 cellspacing=0 bordercolor=#CCCCCC style=‘border-collapse: collapse‘>"
p_page=1
p_member=false
p_groupWhere="groupID=0"
End Sub

Property Let system(value)
p_system=value
end property
Property Let where(value)
if isInt(value) then
p_where=" where categoryID="&value
else
p_where=" where ("&value&")"
end if
end property
Property Let orderBy(value)
p_orderBy=" order by "&value
end property
Property Let recordCount(value)
p_recordCount=value
end property
Property Let horizontal(value)
p_horizontal=value
end property
Property Let mode(value)
p_mode=value
end property
Property Let moreURL(value)
p_moreURL=value
end property
Property Let paginationMode(value)
p_paginationMode=value
end property
Property Let models(value)
p_models=value
end property
Property Let table(value)
p_table=value
end property
Property Let page(value)
if getNumeric(value)<1 then
p_page=1
else
p_page=int(value)
end if
end property
Property Let member(value)

p_member=value

if p_member then
authorizationID=getValue("tblMember","authorizationID","memberID="&session("memberID"))
if authorizationID="" or authorizationID=0 then
authorizationID=getValue("tblGroup","authorizationID","groupID="&session("groupID"))
end if
virtual=getValue("tblAuthorization","virtual","authorizationID="&authorizationID)
authArr=split(virtual,",")
for i=0 to ubound(authArr)
if i=0 then
p_groupWhere="groupID="&getValue("tblGroup","groupID","authorizationID="&authArr(i))
else
p_groupWhere=p_groupWhere&" or groupID="&getValue("tblGroup","groupID","authorizationID="&authArr(i))
end if
next
else
p_groupWhere="groupID=0"
end if
end property

‘列表過程
public sub List()
dim rs
dim where

if p_where="" then
where=" where "&p_groupWhere&" and publish=1"
else
where=p_where&" and ("&p_groupWhere&") and publish=1"
end if

 

strSql="select * from "&p_system&where&p_orderBy
‘response.write strSql
‘response.end
set rs=getRecord(strSql)

if rs.eof then
response.write convertEncode(lgeNoRecord,gb,language)
exit sub
end if

rs.pageSize=p_recordCount

if rs.pagecount<p_page then p_page=rs.pagecount

rs.AbsolutePage=p_page

dim ii
response.write p_table
for i=1 to p_recordCount
if rs.eof then
exit for
end if
response.write "<tr>"
for ih=0 to p_horizontal
if ii=p_recordCount then
exit for
end if
if rs.eof then
response.write "<td width=" & 1/(p_horizontal+1)*100 & "% > </td>"
else
response.write "<td width=" & 1/(p_horizontal+1)*100 & "% >"
execute "call " & p_models
response.write "</td>"
rs.movenext
end if
ii=ii+1
next
response.write "</tr>"
next
response.write "</table>"

if p_mode="more" then
response.write "<div align=right>"&p_moreURL&"</div>"
end if
if p_mode="page" then
response.write "<table width=100% border=0 cellspacing=0 cellpadding=3><tr><td align=right>"
call pagination(p_page,rs.recordCount,rs.pageCount,p_paginationMode)
response.write "</td></tr></table>"
end if
end sub
end class
‘-------------------------------列表過程結(jié)束---------------------------response.End()
end if
end function


 

通過一下的兩個函數(shù)可以實(shí)現(xiàn)圖片,文字的同時提交處理。
Function BinaryToString(str)
strto = ""
for i=1 to lenb(str)
if AscB(MidB(str, i, 1)) > 127 then
strto = strto & chr(Ascb(MidB(str, i, 1))*256+Ascb(MidB(str, i+1, 1)))
i = i + 1
else
strto = strto & Chr(AscB(MidB(str, i, 1)))
end if
next
BinaryToString=strto
End Function

function gainformdata(n)
dim formsize,formdata,divider,datastart,dataend
redim mydata(n-1)
formsize = Request.TotalBytes
formdata = Request.BinaryRead(formsize)
for i=1 to n
bncrlf = chrB(13) & chrB(10)
divider = leftB(formdata,clng(instrB(formdata,bncrlf))-1)
datastart = instrB(formdata,bncrlf & bncrlf)+4
dataend = instrB(datastart+1,formdata,divider) - datastart-2
mydata(i-1) = midB(formdata,datastart,dataend)
formdata=rightB(formdata,clng(formsize-instrB(datastart+1,formdata,divider))+1)
formsize=lenB(formdata)
next
gainformdata=mydata
end function

Demo:
a.htm:
<form name="form1" method="post" action="b.asp" enctype="multipart/form-data">
<textarea name="txt"></textarea>
<input type="file" name="file">
<input type="submit" name="Submit" value="提交">
</form>

b.asp:
‘鏈接數(shù)據(jù)庫
data=gainfromdata(2)
rs("txt")=binarytostring(data(0))
rs("img").appendchunk=data(1)

 

‘==================================================================--

‘ 用ASP實(shí)現(xiàn)無組件上傳/下載文件

‘ 功能簡介
‘ 將上傳的文件數(shù)據(jù)保存到數(shù)據(jù)庫中,可以處理表單中的多個上傳文件的情況
‘ 適用于各種數(shù)據(jù)庫,使用ADO的方法連接數(shù)據(jù)庫
‘ 本示例中使用的是ACCESS數(shù)據(jù)庫:zj.mdb
‘ 表:tb_img(id int(自增列),path text(255) 保存上傳文件的目錄
‘ ,fname text(250) 保存上傳的文件名,type test(250) 保存上傳文件的類型
‘ ,img ole對象 保存上傳的文件內(nèi)容

‘ 鄒建 2003.10
‘==================================================================


‘==================================================================

‘ 上傳文件的HTML頁: zj_up.htm

‘==================================================================
<html>
<head>
<title>文件上傳保存到數(shù)據(jù)庫中</title>
</head>
<body>
<form name="form1" enctype="multipart/form-data" method="post" action="zj_up.asp">
<p>
<input type="file" name="file">
<input type="submit" name="Submit" value="上傳">
</p>
</form>
</body>
</html>


‘==================================================================

‘ 上傳文件保存到數(shù)據(jù)庫的ASP頁: zj_up.asp

‘==================================================================
<%
Response.Expires=0
Function f_Bin2Str(ByVal sBin)
Dim iI, iLen, iChr, iRe
iRe = ""
If Not IsNull(sBin) Then
iLen = LenB(sBin)
For iI = 1 To iLen
iChr = MidB(sBin, iI, 1)
If AscB(iChr) > 127 Then
iRe = iRe & Chr(AscW(MidB(sBin, iI + 1, 1) & iChr))
iI = iI + 1
Else
iRe = iRe & Chr(AscB(iChr))
End If
Next
End If
f_Bin2Str = iRe
End Function
iConcStr = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False" & _
";Data Source=" & server.mappath("zj.mdb")
iSql="tb_img"
set iRe=Server.CreateObject("ADODB.Recordset")
iRe.Open iSql,iConcStr,1,3
iLen=Request.TotalBytes
sBin=Request.BinaryRead(iLen)
iCrlf1 = ChrB(13) & ChrB(10)
iCrlf2 = iCrlf1 & iCrlf1
iLen = InStrB(1, sBin, iCrlf1) - 1
iSpc = LeftB(sBin, iLen)
sBin = MidB(sBin, iLen + 34)
iPos1 = InStrB(sBin, iCrlf2) - 1
While iPos1 > 0
iStr = f_Bin2Str(LeftB(sBin, iPos1))
iPos1 = iPos1 + 5
iPos2 = InStrB(iPos1, sBin, iSpc)

iPos3 = InStr(iStr, "; filename=""") + 12
If iPos3 > 12 Then
iStr = Mid(iStr, iPos3)
iPos3 = InStr(iStr, Chr(13) & Chr(10) & "Content-Type: ") - 2
iFn = Left(iStr, iPos3)
If iFn <> "" Then
iRe.AddNew
ire("path")=left(iFn,instrrev(iFn,"\"))
iRe("fname") = mid(iFn,instrrev(iFn,"\")+1)
iRe("type") = Mid(iStr, iPos3 + 18)
iRe("img").AppendChunk MidB(sBin, iPos1, iPos2 - iPos1)
iRe.Update
End If
End If

sBin = MidB(sBin, iPos2 + iLen + 34)
iPos1 = InStrB(sBin, iCrlf2) - 1
Wend
iRe.close
set iRe=Nothing
%>

‘==================================================================

‘ 下載數(shù)據(jù)的ASP頁: zj_down.asp

‘==================================================================
<%
Response.Buffer=true
Response.Clear

iConcStr = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False" & _
";Data Source=" & server.mappath("zj.mdb")
set iRe=server.createobject("adodb.recordset")
iSql="tb_img"
iRe.open iSql,iconcstr,1,1
Response.ContentType=ire("type")
Response.BinaryWrite iRe("img")

iRe.close
set iRe=Nothing
%>


彈出提示信息 , 確定 與 取消 怎么做的
onclick="{if(confirm(‘確定刪除選定的紀(jì)錄嗎?‘)){this.document.inbox.submit();return true;}return false;}"

6. 組合查詢的優(yōu)化,謝謝
sql = "select * from book where bname like ‘%" & txtbname.Text & "%‘ and bauthor like ‘%" & txtauthor.Text & "%‘ and bpublish like ‘%" & txtpublish.Text & "%‘ and bdescription like ‘%" & txtdescription.Text & "%‘ order by bookid desc"

組合查詢,有是四個組合條件,這樣寫是不是效率比較低,我該怎么優(yōu)化一下呢?
謝謝。

分析,在SQL中,用LIKE是比較費(fèi)時間的,所以最好是少用。

同時 ,四個TEXT框,輸入條件是,一定會有沒有輸入的條件的時候,就會出現(xiàn) LIKE "%"的情況,其實(shí)這種情況下就等于這個條件沒有。

所以,把生成SQL語句的代碼多寫些,
Dim WhereStr as string
if txtbname.Text<>"" then
WhereStr="bname like ‘%" & txtbname.Text & "%‘"
ELSE IF ....
.....
ENDIF
這樣是一個概率的問題,如果四個全輸入的話,是一樣的,但如果只輸入一個的問,速度會比你的快些!

sql = "select * from book where "
If txtbname.Text <> "" Then
sql = sql & "bname like ‘%" & txtbname.Text & "%‘"
ElseIf txtauthor.Text <> "" Then
sql = sql & "bauthor like ‘%" & txtauthor.Text & "%‘"
ElseIf txtpublish.Text <> "" Then
sql = sql & "bpublish like ‘%" & txtpublish.Text & "%‘"
ElseIf txtdescription.Text <> "" Then
sql = sql & "bdescription like ‘%" & txtdescription.Text & "%‘ "
End If

 

8.如何禁止刷新
<SCRIPT LANGUAGE="JavaScript">
document.onkeydown = function() {
if(event.keyCode==116) {
event.keyCode=0;
event.returnValue = false;
}
}
document.oncontextmenu = function() {event.returnValue = false;}
</SCRIPT>
頁面已經(jīng)禁止刷新

12.
sql server 用:sql = "update reg set dealtime=getdate() where id= " & request.querystring("id")
因?yàn)?SQL SERVER里沒有 now() 這個函數(shù),而是用 getdate() 取代了
所以你的會報(bào)錯.
ACCESS沒有這個函數(shù):)
只有date()和now()

 

下載任何文件(尤其是IE關(guān)聯(lián)打開的)
<%
Dim Stream
Dim Contents
Dim FileName
Dim FileExt
Const adTypeBinary = 1
FileName = Request.QueryString("FileName")
if FileName = "" Then
Response.Write "無效文件名."
Response.End
End if
‘ 下面是不希望下載的文件
FileExt = Mid(FileName, InStrRev(FileName, ".") + 1)
Select Case UCase(FileExt)
Case "ASP", "ASA", "ASPX", "ASAX", "MDB"
Response.Write "受保護(hù)文件,不能下載."
Response.End
End Select
‘ 下載這個文件
Response.Clear
Response.ContentType = "application/octet-stream"
Response.AddHeader "content-disposition", "attachment; filename=" & FileName
Set Stream = server.CreateObject("ADODB.Stream")
Stream.Type = adTypeBinary
Stream.Open
Stream.LoadFromFile Server.MapPath(FileName)
While Not Stream.EOS
Response.BinaryWrite Stream.Read(1024 * 64)
Wend
Stream.Close
Set Stream = Nothing
Response.Flush
Response.End
%>

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊舉報(bào)
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
解決ASP連接SQLServer不成功!
ASP直接讀取修改Access數(shù)據(jù)的演示實(shí)例->>網(wǎng)頁教學(xué)網(wǎng)Webjx.Com 提供最新最...
提高ASP性能的最佳選擇(一)
用GetString來提高ASP的速度
網(wǎng)頁代碼
asp學(xué)習(xí)
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服