Сайт создан по материалам книги Г. Бучека "Учебный курс по ASP.NET".
Москва: BHV, 2002.
Создатель сайта-выпускник курсов web-дизайнеров Сафоновского Колледжа Информационных Технологий Максим Котликов |
|||
Сначала извлекается информация о последнем посетителе Web-узла. Для идентификации последнего посетителя производится поиск наибольшего значения поля VisitorlD:
("Select VisitorlD, DateEntered, Browser, " _ & "Platform, MajorVersion, MinorVersion From " _ & "Visitors Where VisitorlD = " _ & "(Select Maic (VisitorlD) From Visitors)" _ , DBConn)
"VisitorRecord")
DSPageData.Tables("VisitorRecord"). _ Rows(0).Item("VisitorlD")
& DSPageData.Tables("VisitorRecord"). _ Rows(0).Item("DateEntered") _ & "<Ьг>браузер: " _ & DSPageData.Tables("VisitorRecord"). _ Rows(O).Item("Browser") & " " _ & DSPageData.Tables("VisitorRecord"). _ Rows(0).Item("MajorVersion") & "." _ & DSPageData.Tables("VisitorRecord"). _ Rows (0) .Item("MinorVersion") _ & "<Ьг>Платформа: " _ & DSPageData.Tables("VisitorRecord"). _ Rows(0).Item("Platform") _ & "<Ьг><Ьг>Просмотренные страницы:<br><br>"
("Select Convert(varchar(25),DateEntefed, 100) " _ & "as [Дата], " _ & "PageName as [Страница] From PageViews " _ & "Where VisitprlD = " & Session("CurrentVisitorlD") _ & " Order By DateEntered", DBConn) DBCoiranand.Fi11(DS PageData, _ "PageViews")
DSPageData.Tables{"PageViews").DefaultView dgPageViews.DataBind()
Dim DBConn as OleDbConnection Dim DBCommand As OleDbDataAdapter Dim DSPageData as New DataSet DBConn = New OleDbConnection("Provider=sqloledb;" _ & "server=localhost;" _ & "Initial Catalog=INETC8;" _ & "User Id=sa;" & "Password=yourpassword;") DBCommand = New OleDbDataAdapter _ ("Select VisitorlD, DateEntered, Browser, " _ & "Platform, MajorVersion, MinorVersion From " _ & "Visitors Where VisitorlD = " _ & "(Select Max(VisitorlD) From Visitors " _ & "Where VisitorlD < " _ & Session("CurrentVisitorlD") & ")", DBConn) DBCommand.Fill(DSPageData, _ "VisitorRecord") If DSPageData.Tables("VisitorRecord").Rows.Count = 0 Then IblMessage.Text = "Нет посещений." Else Session("CurrentVisitorlD") = _ DSPageData.Tables("VisitorRecord"). _ Rows(O).Item("VisitorID") IblMessage.Text = "Дата: " _ & DSPageData.Tables("VisitorRecord"). _ Rows (0) .ItemC'DateEntered") _ & "<Ьг>браузер: " _ & DSPageData.Tables("VisitorRecord"). _ Rows(0).Item("Browser") & " " _ & DSPageData.Tables("VisitorRecord"). _ Rows(0).Item("MajorVersion") & "." _ & DSPageData.Tables)"VisitorRecord"). _ Rows(O).Item("MinorVersion") & "<bг>Платформа: " _ & DSPageData.Tables("VisitorRecord"). Rows(O).Item("Platform") _ & "<Ьг><Ьг>Просмотренные страницы:<br><br>" DBCommand = New OleDbDataAdapter _ ("Select Convert(varchar<25),DateEntered,100) "_ & "as [Дата], " _ & "PageName as [Страница] From PageViews " _ & "Where VisitorlD = " & Session("CurrentVisitorlD") _ & " Order By DateEntered", DBConn) DBCommand.Fill(DSPageData, _ "PageViews") dgPageViews.DataSource = _ DSPageData.Tables("PageViews").DefaultView dgPageViews.DataBind () End If End Sub
|
|||