错误信息提示:
错误号:12142

错误原因:

错误SQL语句:
select * from user_skin where  find_in_set('sysai.net',replace(host,'|',','))

Warning: fopen(/error/2025-06-27.txt): failed to open stream: No such file or directory in /opt/lampp/htdocs/sysai/inc/datai.php on line 247
文件 2025-06-27.txt 不可写

sysai
『 자료실 』
현재위치 : HOME > 자료실
在ASP中文本数据的实现
글쓴이 : 매니저 작성일 : 2009-01-13

如果数据足够简单是可以考虑使用文本数据的。

在ASP中,要进行文件的存取必须先建立FileSystemObject对象, 再用建立出来的这个文件对象来进行文件各项操作,用法:
set fileobject=server.createObject(“scripting.FileSystemObject”),

用createTextFile来建立文本文件:
set 文件对象名=filesystemObject 对象名.createTextFile

用OpenTextFile来打开文件
set 文件对象名=filesystemObject 对象名.OpenTextFile

接下来就是文件的读写了,用ReadLine和WriteLine方法来逐行读写,
用ReadAll方法来读取全部内容,另外还会用到MoveFile来更改文件,
它的作用是复制一个文件名称不同而数据相同的文件,
当然你可以用CopyFile来复制,但这只能将一个文件复制成另一个文件,
最后再来说说deleteFile,用法:
文件对象名.deleteFile 路径 文件名

在本例中只需两个页面:index.asp


显示留言


显示留言












填 写 留 言






昵称:
具体留言内容:












2、处理页面:add.asp

<%
name = Request("name")
textmemo=Request("textmemo")
If name = "" Or textmemo = "" Then
Response.Write ""
Response.End
End If

'以下为读入数据的处理,先将计入的栏位数据改写成
'HTML形式以方便直接调用
Line1 = "昵 称:" & name & "
"
textmemo = Replace( textmemo, vbCrLf, "BR" )'把换行字符vbcrlf取代为

Line2 ="内 容:" & textmemo

On Error Resume Next
Set fileobject = Server.createObject("Scripting.FileSystemObject")
Application.Lock '避免两们或两们以上的连接同时进行网页链接
FilePath = Server.MapPath("information.txt")'取得完整的路径
OldFilePath = Server.MapPath("oldinfo.txt")
fileobject.MoveFile FilePath, OldFilePath'将information.txt更名复制为oldinfo.txt
Set TEMP = fileobject.OpenTextFile(OldFilePath, , True)'打开oldinfo.txt

Set newmessage = fileobject.createTextFile(FilePath)'建立information.txt
newmessage.WriteLine Line1
newmessage.WriteLine Line2
newmessage.WriteLine "
"
newmessage.WriteLine TEMP.ReadAll'一次读取整个oldinfo.txt的内容写入
TEMP.Close
fileobject.deleteFile OldFilePath, True'删除oldinfo.txt
Application.UnLock
Response.Redirect "index.asp"
%>
 

목록


홈으로 | 이용안내 | 이용약관 | 개인정보보호정책 | 제휴문의 | 질문과답변 | 자주하는 질문
Copyright © 2011 - 2014 SYSAI Work Group, All Rights Reserved 주소:길림성연길시,우편:133300 Version 3.0 Run Time 0.226s