?? 顯示文章.aspx.vb
字號:
Imports System.Data.SqlClient
Imports CasingCNCls.clsArticles
Imports System.IO
Public Class 顯示文章
Inherits System.Web.UI.Page
Dim sql As String
Protected WithEvents DataGrid2 As System.Web.UI.WebControls.DataGrid
Dim mid As String
#Region " Web 窗體設計器生成的代碼 "
'該調用是 Web 窗體設計器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
'注意: 以下占位符聲明是 Web 窗體設計器所必需的。
'不要刪除或移動它。
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: 此方法調用是 Web 窗體設計器所必需的
'不要使用代碼編輯器修改它。
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此處放置初始化頁的用戶代碼
view()
End Sub
Sub view()
read()
Dim str As CasingCNCls.clsArticles
mid = Request.QueryString("id")
Dim conn As SqlConnection
conn = New SqlConnection(sql)
Dim comm As SqlCommand
Dim comm2 As SqlCommand
comm = New SqlCommand("select 摘要 from tblArticles where 文章代碼='" & mid & "' ", conn)
comm2 = New SqlCommand("select 標題,加入時間 from tblArticles where 文章代碼='" & mid & "'", conn)
conn.Open()
datagrid2.datasource = comm2.ExecuteReader
DataGrid2.DataBind()
conn.Close()
conn.Open()
DataGrid1.DataSource = comm.ExecuteReader
DataGrid1.DataBind()
conn.Close()
conn = Nothing
comm = Nothing
' str.文章代碼 = mid
End Sub
Sub read()
Dim str As System.IO.StreamReader
str = File.OpenText(Server.MapPath("sql.txt"))
sql = str.ReadToEnd
str.Close()
End Sub
End Class
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -