示例代碼:
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)隔的内容其中(zhōng)的某一(yī)部份</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('操作成功!');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>
- <%
文章整理:
世紀雲圖 https://www.yuntop.cc/
以上信息與文章正文是不可分(fēn)割的一(yī)部分(fēn),如果您要轉載本文章,請保留以上信息,謝謝!
版權申明:本站文章部份來自網絡,如有侵權,請聯系我(wǒ)們,我(wǒ)們收到後立即删除,謝謝!
特别注意:本站部份轉載文章言論不代表本站觀點,本站所提供的攝影照片,插畫,設計作品,如需使用,請與原作者聯系,版權歸原作者所有。