FSO Example _FSO topic

Source: Internet
Author: User
<!--#include file= "config.asp"-->
<!--#include file= "Inc/articlechar.inc"-->
<%
function CHANGECHR (str)
Changechr=replace (replace (CHANGECHR, [pic], " ")," [Big] "," <font size=7> ")
Changechr=replace (replace (replace (CHANGECHR, [/pic], ></img>), "[/b]", "</b>"), "[/red]" , "</font>"), "[/big]", "</font>")
Changechr=replace (replace (replace (str, <, <), ">", ">"), Chr (+), "<br>"), "", "" "
End Function
%>

<%
If Request.Cookies ("Newsadminok") = "" Then
Response.Redirect "Login.asp"
End If
If Request.Form ("txttitle") = "" Then
Response.Write "error message: Please enter the news title!"
Response.End
End If
If Request.Form ("txtcontent") = "" Then
Response.Write "error message: Please do not enter news content!"
Response.End
End If
Dim title
Dim content
Dim sql
Dim rs
Dim ArticleID
Dim classid,nclassid
Dim from

Title=htmlencode2 (Request.Form ("Txttitle"))
From=request.form ("Nfrom")
Zznews=request.form ("Zznews")
Typeid=request.form ("typeID")
About=request.form ("about")
Headline=request.form ("headline")
Ftitle=htmlencode2 (Request.Form ("Ftitle"))

Dim sql1
Dim rs1
Dim typename
Sql1= "SELECT * from type where typeid=" & typeID
Set Rs1=server.createobject ("Adodb.recordset")
Rs1.open sql1,conn,1,1
Typename=rs1 ("type")

If Request.Form ("checkbox1") = "1" Then
Tjnews=1
Else
tjnews=2
End If

If Request.Form ("yheadline") = "1" Then
Yheadline=1
Else
Yheadline=0
End If

Content=htmlencode (Request.Form ("Txtcontent"))

Set rs = server. CreateObject ("ADODB.") RecordSet ")
strSQL = "Select E_memo from Example"
Set rs = conn. Execute (strSQL)




FName = Makefilename (now ())



dddd = year (now) & "Years" & Month (now) & "Month" & Day (now) & "Days" & Hour (now)) & ":" &minute ( Now ())
Pencat=rs ("E_memo")
Pencat=replace (Pencat, "LX", TypeName)
Pencat=replace (Pencat, "Date", dddd)
If from= "" Then
Pencat=replace (Pencat, "from", "")
Else
Pencat=replace (Pencat, "from", "Excerpt:" & From)
End If
If zznews= "" Then
Pencat=replace (Pencat, "Fname", Editor)
Zznews=editor
Else
Pencat=replace (Pencat, "Fname", Zznews)
End If
Pencat=replace (Pencat, "H_title", Title)
Pencat=replace (Pencat, "H_memo", content)
Pencat=replace (Pencat, "Labout", about)
Pencat=replace (Pencat, "Ftitle", Ftitle)

Newsdate = year (today ()) & "." & Month (now) & "." & Day (now)
Timepath = year (today ()) & "-" & Month (now ()) & "-" & Day (Now ())
FolderPath = Server.MapPath (".") & "\" & Timepath



Rs.close
' Save the news in the database

Sql= "SELECT * from article where (NewSID is null)"

Rs.Open sql,conn,1,3
Rs.addnew
RS ("title") =title
RS ("content") =content
RS ("Nfrom") =from
RS ("typeID") =typeid
RS ("path") =timepath
RS ("TypeName") =typename
RS ("Tjnews") =tjnews
RS ("N_fname") =fname
RS ("Zznews") =zznews
RS ("about") =about
RS ("Newsdate") =newsdate
RS ("Yheadline") =yheadline
RS ("headline") =headline
If Ftitle <> "" Then RS ("Ftitle") =ftitle
Rs.update

Pencat=replace (Pencat, "h_id", RS ("NewSID"))

Set FSO = Server.CreateObject ("Scripting.FileSystemObject")
If Checkdir (folderpath) = True Then
Set fout = fso. CreateTextFile (FolderPath & "\" & fname)
Else
Makenewsdir Timepath
Set fout = fso. CreateTextFile (FolderPath & "\" & fname)
End If
Fout. WriteLine Pencat
Fout.close

Articleid=rs ("NewSID")
Updatejs (News)
Rs1.close
Set rs1=nothing
Rs.close
Set rs=nothing
Conn.close
Set conn=nothing
Response.Redirect "Addnews.asp"
%>

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.