ASP读取文件 ASP写入/保存文件
2016-03-31 10:34
435 查看
ASP读取文件: 简洁版: CreateObject("Scripting.FileSystemObject").OpenTextfile(Server.MapPath("Muma.txt"),1,False).Readall 完整版: set fs=server.createobject("scripting.filesystemobject") file=server.mappath("pic/fuck.txt") set txt=fs.opentextfile(file,1,true) if not txt.atendofstream then line=txt.readall 'ReadLine从文件中读取一行数据;Read(N)从文件中读取N个字节的数据;ReadAll读取文件中的所有数据 'response.write "<p align='center'><textarea name='reg' cols=80 rows=25 style=background:#000000;color=#00ff00 id=1>"&line&"</textarea></p>" '显示到textarea |
ASP写入/保存文件: 简洁版: Server.CreateObject("Scripting.FileSystemObject").OpenTextFile(Server.MapPath("test.txt"),2,True).WriteLine Request("TxtData") 完整版: Set Fs=Server.CreateObject("Scripting.FileSystemObject") Set File=Fs.OpenTextFile(Server.MapPath("ip.txt"),2,True) '2覆盖,8追加;True文件不存在则自动创建.Flase不自动创建 File.Writeline ip+":"+port 'file.writeline 会写入换行符,file.write 不会写入换行符 File.Close |
相关文章推荐
- 如何组织构建多文件 C 语言程序(二)
- 八成小网站存在被入侵风险,特别是ASP
- 如何写好 C main 函数
- 三维免费空间提供多款免费ASP空间(1G)
- 一段asp防注入的通用脚本
- 不错的主要用于加密的vbs(asp)位移运算类
- 一个简单的asp数据库操作类
- 用ASP编写的加密和解密类
- asp获取当前文件名的代码
- 本站新增dig功能,欢迎大家使用
- ASP程序与SQL存储过程结合使用详解
- asp防止上传图片木马原理解析
- asp下连接数据库 ASP链接数据库字符串大全总结第1/2页
- asp智能脏话过滤系统v1.0第1/2页
- ASP实现文件直接下载的代码
- ASP 代码出现80040e14错误的解决方法
- 整理了下手动注入脚本命令[带注释]
- asp 80070005 80070006 FSO等问题终级解决方法
- Serv-U本地权限提升的ASP版实现
- ASP利用XMLHTTP实现表单提交以及cookies的发送的代码