您目前尚未登陆,请选择【登陆】或【注册
首页->留言本类->晶晶Vb.net留言板源码>>reply.aspx.vb>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:晶晶Vb.net留言板源码
当前文件:文件类型 VbGuestBook/reply.aspx.vb打开代码结构图
普通视图
		            
1Imports System 2Imports System.ComponentModel 3Imports System.Data 4Imports System.Data.OleDb 5Imports System.Web 6Imports System.Web.SessionState 7Imports System.Web.UI 8Imports System.Web.UI.WebControls 9Imports System.Configuration 10Imports Microsoft.VisualBasic 11 12Public Class reply 13 Inherits System.Web.UI.Page 14 Protected WithEvents LB As System.Web.UI.WebControls.Label 15 Protected WithEvents Button1 As System.Web.UI.WebControls.Button 16 Protected WithEvents Button2 As System.Web.UI.WebControls.Button 17 Protected WithEvents TB As System.Web.UI.WebControls.TextBox 18 19Web 窗体设计器生成的代码 33 34 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 35 If Session("name") <> ConfigurationSettings.AppSettings("站长") Then Response.Redirect("default.aspx") 36 Dim ID As String, page As String 37 ID = Request.QueryString("ID") 38 page = Request.QueryString("page") 39 If ID.Length < 1 Then Response.Redirect("default.aspx") 40 If Not IsPostBack Then 41 Dim conn As OleDbConnection, comd As OleDbCommand, dr As OleDbDataReader 42 conn = New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & Server.MapPath(ConfigurationSettings.AppSettings("数据库"))) 43 comd = New OleDbCommand("Select 内容,回复 From 留言 Where ID=" + ID, conn) 44 comd.Connection.Open() 45 dr = comd.ExecuteReader 46 If dr.Read Then 47 LB.Text = dr(0) 48 TB.Text = dr(1).ToString 49 Else 50 Response.Redirect("default.aspx") 51 End If 52 dr.Close() 53 comd.Connection.Close() 54 comd.Dispose() 55 conn.Close() 56 conn.Dispose() 57 End If 58 End Sub 59 60 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 61 Response.Redirect("default.aspx") 62 End Sub 63 64 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 65 Dim ID As String, page As String, text As String 66 ID = Request.QueryString("ID") 67 page = Request.QueryString("page") 68 If ID.Length < 1 Then Response.Redirect("default.aspx") 69 Dim conn As OleDbConnection, comd As OleDbCommand 70 conn = New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & Server.MapPath(ConfigurationSettings.AppSettings("数据库"))) 71 comd = New OleDbCommand("Update 留言 Set 回复=@p1 Where ID=" + ID, conn) 72 comd.Parameters.Add(New OleDbParameter("@p1", OleDbType.Char)) 73 text = TB.Text 74 If text.Length < 1 Then text = "谢谢你的留言" 75 text = Replace(text, vbCrLf, "<br>") 76 comd.Parameters("@p1").Value = text 77 comd.Connection.Open() 78 comd.ExecuteNonQuery() 79 comd.Connection.Close() 80 comd.Dispose() 81 conn.Close() 82 conn.Dispose() 83 Response.Redirect("default.aspx?page=" + page) 84 End Sub 85End Class 86
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:晶晶Vb.net留言板源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号