以下为引用的内容: <% Dim post,filename,path,path1,yes,content post=request("post") filename=request("filename") path=request("path") path1=replace(path,"/","") yes=request("yes") content=request("content") If post=1 Then If filename="" Or path="" Or yes="" Or content="" Then response.write "对不起你有某项内容没有填写无法生成!" '如果用户信息填写不完全就返回错误信息 response.End else set fso = Server.CreateObject("Scripting.FileSystemObject") '设置FSO对象 If yes=1 Then '如果用户选择了"如果路径不存在就创建新文件夹", If Not fso.FolderExists(server.mappath(""&path&"")) Then '则检查用户输入的文件夹是否存在 fso.CreateFolder (server.mappath(""&path1&"")) '不存在就自动创建 End If Else '如果用户选择了"如果路径不存在不自动创建新文件夹", If not fso.FolderExists(server.mappath(""&path&"")) Then '则检查用户输入的文件夹是否存在 response.write "路径不存在,请后退重新输入!" '如果路径不存在就提示用户返回重写 response.End End If End If End If set fout = fso.CreateTextFile(server.mappath(""&path&"/"&filename&"")) '设置一个对象fout创建文件 fout.write content '把文件内容写入文件 response.write "生成成功!" '给用户返回生成成功的信息 response.end fout.close '关闭fout对象 set fout=Nothing '清空fout对象 set fso=Nothing '清空FSO对象 End If %> |
关键词标签:实例,详解,原创,简单,
相关阅读
热门文章
ASP编程代码:隐藏图片的真实地址
ASP教程:0177:800401f3错误解决
ASP代码中如何屏蔽ip地址 禁止某IP段访问网站
错误80004005信息处理方法
人气排行 ASP下标越界的解决方法 ASP代码中如何屏蔽ip地址 禁止某IP段访问网站 “文件共享锁定数溢出” 原因及解决方法 无法写入数据库的解决方法 ASP教程:0177:800401f3错误解决 ASP常用函数列表 如何用ASP来获取客户端真实IP的地址 ASP用FSO生成HTML简单实例+详解[原创]
查看所有0条评论>>