如何用j**a编写简单的网上银行系统不要和数据库连接!步骤详细有注释!
Im Bobby
2024-11-15 18:21:02
最佳回答
可写入文本文档或是用xml 可担当小数据库的功能(但不是数据库)。如:'向xml文件添加留言记录的函数addentry() function addentry() '定义局部变量 dim strname dim stremail dim strurl dim str** '取得留言表单的输入内容 strname = request.form("姓名") stremail = request.form("电子邮件") strurl = request.form("网址") str** = request.form("留言") dim objxml dim objentry dim objname dim objemail dim objurl dim obj** '向xml文件添加留言内容 set objxml = server.createobject("msxml2.domdocument") objxml.async = false objxml.load(server.mappath("guestbook.xml")) set objentry = objxml.createnode("element", "留言记录", "") objxml.documentelement.appendchild(objentry) set objname = objxml.createnode("element", "留言者姓名", "") objentry.appendchild(objname) objname.text = strname set objemail = objxml.createnode("element", "电子邮件", "") objentry.appendchild(objemail) objemail.text = stremail set objurl = objxml.createnode("element", "网址", "") objentry.appendchild(objurl) objurl.text = strurl set obj** = objxml.createnode("element", "留言内容", "") objentry.appendchild(obj**) obj**.text = str** objxml.s**e(server.mappath("guestbook.xml")) response.redirect("guestbook.asp") end function '填写和发送留言表单的函数entryform() function entryform() response.write "<p align='center'><b>xml 留言本 例子</b></p>" response.write "<hr color='#000099' width='100%' noshade>" response.write "<form action=guestbook.asp?action=addentry method=post>" response.write "<table border=1>" response.write "<tr><td>您的姓名:</td><td><input type=text name=姓名 /></td></tr>" response.write "<tr><td>电子邮件:</td><td><input type=text name=电子邮件 /></td></tr>" response.write "<tr><td>您的网址:</td><td><input type=text name=网址 /></td></tr>" response.write "<tr><td>您的留言:</td><td><textarea name=留言 cols=40 rows=5></textarea></td></tr>" response.write "<tr><td> </td><td><input type=submit value=发布留言 /></td></tr>" response.write "</table>" response.write "</form>" 20210311