asp版本简单的留言板的制作
日期:2008年9月22日 作者:-
在留言的录入界面完成后,自然要准备做留言内容的录入了。这个其中一个很关键的地方就是
如何将我们在config.web 的内容读取出来,我用了下面的几条语句
Dim Cfg as HashTable
Cfg = Context.GetConfig("appsettings")
Conn = New SQLConnection(cfg("Conn"))
这样就得到了我们在config.web 中设定的 连接串,程序如下
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQL" %>
<script runat="server" language="VB">
Sub Page_Load(Src As Object, E As EventArgs)软件开发网 www.mscto.com
Dim conn As SQLConnection
Dim Cfg as HashTable
Cfg = Context.GetConfig("appsettings")
Conn = New SQLConnection(cfg("Conn"))
dim strSQL as string
dim strNickName as string
dim strMail as string
dim strTitle as string
dim strContent as string
dim strIPAddr as string
strNickName=replace(request.form("txtName"),"'","'")
strEmail=replace(request.form("txtMail"),"'","'")
strTitle=replace(request.form("txtTitle"),"'","'")
strContent=replace(request.form("txtContent"),"'","'")
strIPAddr=Request.ServerVariables ("REMOTE_ADDR") '用户IP地址
strSQL="insert into msgBoard(nickname,email,ipAddr,msgTime,msgTitle,msgContent)values("
strSQL=strSQL & "'" & strNickName & "','" & strEMail & "','" & strIPAddr & "',getdate(),'" & strTitle & "','" & strContent & "')"
response.write(strSQL)
Dim Cmd As SQLCommand
Cmd = New SQLCommand(strSQL,conn)
Cmd.ActiveConnection.Open() - [1] [2] 下一页
-
- asp版本简单的留言板的制作 相关文章:
- asp版本简单的留言板的制作 相关软件
- 特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作
- 者.文章版权归文章原始作者所有.对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转
- 载的文章有版权问题请联系编辑人员,我们尽快予以更正. 转载请注明来源:http://www.hackhome.com
| ·网页设计技巧及网页制作常见问题 |
| ·三维立体图制作精灵 1.5.0 |
| ·ASP教程全集 |
| ·友益电子试卷制作系统 3.9.5 |
| ·SpeedMT课件制作工具 5.0 |
| ·ebookPK-e书部落电子书制作器 2.1.0 |
| ·影楼电子相册制作系统2009 3.0 白金版 |
| ·名片制作专家 9.5 |
上一篇:asp.net的基本应用
