Creating a News publishing system using text + ASP (4) news deletion/News deletion

Source: Internet
Author: User
Tags split
<! -- # Include file = "news_session.asp" -->
<%
Dim id
Id = Request. QueryString ("id ")
Dim myfso
Set myfso = createobject ("scripting. filesystemobject ")
If myfso. FileExists (server. mappath ("./news_content/" & id & ". txt") then
Myfso. DeleteFile (server. mappath ("./news_content/" & id & ". txt") '########### delete news content
End if
    
Dim mytext2, myread2
Set myread2 = myfso. opentextfile (server. mappath ("./new_list.asp"), 1, 0)
If myread2.atendofstream then
Response. Write "no news content"
Myread2.close
Response. End
End if
Mytext2 = myread2.readall
Myread2.close
Dim listarray, I, h, count, sf, title
Listarray = split (mytext2, "|") '######## read records and split them into listarray arrays
Count = ubound (listarray)
For I = 0 to count' ########## find the news by ID for deletion
Sf = split (listarray (I ),",")
If right (sf (0), 7) = right (id, 7) then
Dim thisid
Thisid = I
          
'####### 6 indicates that an image is uploaded, and news images and the list record are deleted.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.