示例代碼:
ASP/Visual Basic代碼
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
- <%Action=Request.QueryString("Action")
- Dim aID,aryTemp,Total,i,j,csID
- csID=25
- j=1%>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>實例删除Split分(fēn)隔的内容其中的某一部份</title>
- <style type="text/css">
- * {margin:0px; padding:0px; line-height:180%;}
- a {color:#666666; text-decoration:none;}
- </style>
- </head>
- <body>
- <%
- Function RtnReplaceInt(iCheck,iDefault)
- If Trim(iCheck)="" Then
- RtnReplaceInt = iDefault
- Exit Function
- End If
- If IsNumeric(iCheck)=false Then
- RtnReplaceInt = iDefault
- Exit Function
- End If
- RtnReplaceInt = iCheck
- End Function
- Select Case Action
- Case "Add"
- Call AddPic
- Case "Delete"
- Call DeletePic
- Case else
- Manage
- End Select
- sub Manage
- end sub
- sub DeletePic
- uPic=Request("DelPic")
- Str=Request("nPic")
- Str=Replace(Str,uPic",","")
- Str=Replace(Str,","&uPic,"")
-
-
- PicID=RtnReplaceInt(Request("PicID"),0)
- sql="update 表名 set 字段='"&Str"' where 數據庫ID in ("&Request("PicID")")"
- conn.execute(sql)
- Response.write"<script>alert('操作(zuò)成功!');location.href='?Action=Manage'</script>"
- Response.end
- end sub%>
- <p> </p>
- <table width="80%" border="0" align="center" cellspacing="0">
- <tr>
- <%aID="20101111212349940.jpg,20101111212351417.jpg,20101111212357390.jpg,20101111212402671.jpg,20101111212404837.jpg"
- aryTemp = Split(aID,",")
- Total=UBound(aryTemp)
- for i=0 to Total
- %>
- <td align="center"><a href="<%= aryTemp(i) %>"><img src="<%= aryTemp(i) %>" width="100" height="100" style="border:1px #cccccc solid;"></a><BR><a href="?Action=Delete&DelPic=<%= aryTemp(i) %>&PicId=<%= csID %>&nPic=<%= aID %>">删除</a></td>
- <%
文章(zhāng)整理(lǐ):
世紀雲圖 /
以上信息與文章(zhāng)正文是不可(kě)分(fēn)割的一部分(fēn),如(rú)果您要轉載本文章(zhāng),請(qǐng)保留以上信息,謝謝!
版權申明:本站(zhàn)文章(zhāng)部份來(lái)自(zì)網絡,如(rú)有侵權,請(qǐng)聯系我們,我們收到後立即删除,謝謝!
特别注意:本站(zhàn)部份轉載文章(zhāng)言論不代表本站(zhàn)觀點,本站(zhàn)所提供的攝影(yǐng)照(zhào)片,插畫(huà),設計(jì)作(zuò)品,如(rú)需使用,請(qǐng)與原作(zuò)者聯系,版權歸原作(zuò)者所有。