海南世纪云图网络科技有限公司
咨询热线:400-822-8458 客户服务:0898-32183600 无障碍阅读 适老模式

Asp实例删除Split分隔的内容其中的某一部份

发表于:2011-07-19 00:00:00来源:SOUAB.COM人气:3225

示例代码:

ASP/Visual Basic代码
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>   
  2. <%Action=Request.QueryString("Action")   
  3. Dim aID,aryTemp,Total,i,j,csID   
  4. csID=25   
  5. j=1%>   
  6. <html>   
  7. <head>   
  8. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />   
  9. <title>实例删除Split分隔的内容其中的某一部份</title>   
  10. <style type="text/css">   
  11. * {margin:0px; padding:0px; line-height:180%;}   
  12. a {color:#666666; text-decoration:none;}   
  13. </style>   
  14. </head>   
  15. <body>   
  16. <%   
  17. Function RtnReplaceInt(iCheck,iDefault)    
  18.  If Trim(iCheck)="" Then  
  19.   RtnReplaceInt = iDefault   
  20.   Exit Function  
  21.  End If  
  22.  If IsNumeric(iCheck)=false Then  
  23.   RtnReplaceInt = iDefault   
  24.   Exit Function  
  25.  End If  
  26.  RtnReplaceInt = iCheck   
  27. End Function  
  28. Select Case Action   
  29. Case "Add"  
  30. Call AddPic   
  31. Case "Delete"  
  32. Call DeletePic   
  33. Case else   
  34. Manage   
  35. End Select  
  36. sub Manage   
  37. end sub   
  38. sub DeletePic   
  39. uPic=Request("DelPic")   
  40. Str=Request("nPic")   
  41. Str=Replace(Str,uPic",","")   
  42. Str=Replace(Str,","&uPic,"")   
  43. 'Response.Write(""&Str&"")   
  44. 'Response.End()   
  45. PicID=RtnReplaceInt(Request("PicID"),0)   
  46. sql="update 表名 set 字段='"&Str"' where 数据库ID in ("&Request("PicID")")"    
  47. conn.execute(sql)    
  48. Response.write"<script>alert('操作成功!');location.href='?Action=Manage'</script>"  
  49. Response.end   
  50. end sub%>   
  51. <p> </p>   
  52. <table width="80%" border="0" align="center" cellspacing="0">   
  53.   <tr>   
  54.   <%aID="20101111212349940.jpg,20101111212351417.jpg,20101111212357390.jpg,20101111212402671.jpg,20101111212404837.jpg"  
  55. aryTemp = Split(aID,",")   
  56. Total=UBound(aryTemp)   
  57. for i=0 to Total   
  58. %>   
  59.     <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>   
  60.  <%   

    文章整理: 世纪云图  https://www.yuntop.cc/

    以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

    版权申明:本站文章部份来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!

    特别注意:本站部份转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。