海口秀英隆智慧網絡科技工作室
咨詢熱線:400-822-8458 客戶服務:0898-32183600

Asp實例删除Split分隔的(de)內(nèi)容其中的(de)某一(yī)部份

發表于:2011-07-19 00:00:00來源:SOUAB.COM人氣:3178

示例代碼:

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分隔的(de)內(nèi)容其中的(de)某一(yī)部份</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.  <%   

文章(zhāng)整理(lǐ): 世紀雲圖  /

以上信息與文章(zhāng)正文是不可(kě)分割的(de)一(yī)部分,如(rú)果您要轉載本文章(zhāng),請保留以上信息,謝謝!

版權申明:本站文章(zhāng)部份來自(zì)網絡,如(rú)有侵權,請聯系我們,我們收到後立即删除,謝謝!

特别注意:本站部份轉載文章(zhāng)言論不代表本站觀點,本站所提供的(de)攝影照片,插畫,設計作品,如(rú)需使用,請與原作者聯系,版權歸原作者所有。

微信
網站建設
軟件業務
網絡營銷
400電話