手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>网络编程>Asp.Net编程>列表

Asp.net Xml实现无数据库论坛一点即通

来源:互联网 作者:west263.com 时间:2008-02-22
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

"<document>" & vbcrlf & " <record>" & vbcrlf & " <anthor>" & session("who") & "</anthor>" & vbcrlf & _
" <title>" & server.HTMLEncode(biaoti.value) & "</title>" & vbcrlf & " <date>" & now & "</date>" & vbcrlf & _
" <gengxindate>" & now & "</gengxindate>" & vbcrlf & " <body>" & server.HTMLEncode(neirong.text) & "</body>" & vbcrlf & _
" </record>" & vbcrlf & "</document>")
newfile.close:newfile=nothing
%>

10:删除指定文件

<%@import namespace='system.io'%>
<%file.delete(server.mappath("data\2.xml"))%>

11:用cookies实现7秒内不许重复灌水

<%
if not request.cookies("lshdicbbs") is nothing then
if isdate(request.cookies("lshdicbbs")("guanshui"))=false then response.cookies("lshdicbbs")("guanshui")=now
if datediff("s",request.cookies("lshdicbbs")("guanshui"),now)<7 then response.write ("7秒内禁止重复发贴灌水"):response.cookies("lshdicbbs")("guanshui")=now:response.end
end if
response.cookies("lshdicbbs")("guanshui")=now
%>

12:用正则表达式限制用户提交的数据必须为英文字母(有兴趣可延伸强化为支持英文字母 数字的形式)

<%
dim name1=request.form("username")
if regex.replace(name1,"[a-z] ","",RegexOptions.IgnoreCase)<>"" then t2("帐号名必须使用A-Za-z范围的英文字母")
%>

13:扩展提示工具(早先原创脚本,可根据需要修改)

<div style='position:absolute;left:0;top:0;border-bottom:1 solid green;border-right:1 solid green;border-left:1 solid cccccc;border-top:1 solid cccccc;display:none;z-index:500;background-color:#FFF7FF;padding:2;white-Space:nowrap;table-Layout:fixed;' id=showdiv></div>
<script>
var oldtext="加速变量",colors1=new Array("#FFECD5","#FFF7FF","#FFFFEB","white","#F5FFEB","#EEFAFF","#FFFFEE","#EDFFFC")
function document.onmousemove(){
try{
if(event.srcElement.getAttribute('lshdic'))
{
showdiv.style.left=event.x-3;showdiv.style.top=event.y document.body.scrollTop 18;if(event.srcElement.lshdic!=oldtext){oldtext=event.srcElement.lshdic;showdiv.innerText=oldtext;showdiv.style.backgroundColor=colors1[Math.round(Math.random()*colors1.length)]};if(showdiv.style.display=='none')showdiv.style.display=''
}else{if(showdiv.style.display=='')showdiv.style.display='none';}}catch(e){}
}
</script>
<a href="http://www.lshdic.com" lshdic='欢迎访问作者网站'>蓝丽网</a>
<a href="http://www.lshdic.com/bbs" lshdic='欢迎访问蓝丽技术论坛&#13;&#13;2003-12-6 10:31:32'>蓝丽技术论坛</a>

第五节:神剑在此、赠我知音

经过以上4个章节的艰苦学习,我相信您以基本了解了如何用后台程序结合XML数据库实现复杂的论坛和系统,但通读N边也起不了实际作用,你必须着手去做,才能在实践中总结出自己的经验,本文章仅仅是个辅助参考而已

由于时间有限,本人只能将亲手开发的ASP。NET版本的XML无数据库论坛(全称:蓝丽NetXml无数据库论坛1.0)奉献给各位研究,由于本人的ASP。NET虚拟空间有点问题,无法提供在线演示,现仅提供全部原代码下载(以上13例原代码多数采摘于本系统中),地址:http://www.lshdic.com/download/netxmlbbs.rar,下载后可参考帮助文件,在您自己的ASP。NET服务器上测试。

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!