SiteRequestTracer - Система аналізу і трасування усіх реквестів до сайту.
На цій сторінці я розповім про свою систему, яка дозволяє побачити очима і зробити власні обробники-аналізатори усіх реквестів до сайту, особливо POST-реквестів. Це може бути потрібним у багатьох випадках, наприклад пошуку вірусної атаки чи якогось цікавого стану, у який попадає сайт незрозуміло чому.
Моя Система працює не заважаючи звичайним операціям сайту і при належної настройці майже не дає зайвого напруження обладнання, тобто час відклику сайта майже не збільшується.
Налаштування системи починається з додатку в Global.asax декількох стрічок, що будуть відслідковувати усі реквести і запам'ятовувати їх у базу.
1: <%@ Application Language="VB" %>
2:
3: <script runat="server">
4:
5: Sub Application_BeginRequest(ByVal sender As Object, ByVal e As System.EventArgs)
6: If CBool(System.Configuration.ConfigurationManager.AppSettings("TraceRequest")) Then
7: Dim X As New TraceRequest
8: X.SaveToLog(sender, e)
9: End If
10: End Sub
11:
12: ...
Саме таким чином заповнюється ось така табличка в базі:
1: CREATE TABLE [dbo].[TraceLog](
2: [i] [int] IDENTITY(1,1) NOT NULL,
3: [CrDate] [datetime] NOT NULL,
4: [RawUrl] [nvarchar](1000) NULL,
5: [UrlReferrer] [nvarchar](1000) NULL,
6: [HttpMethod] [nvarchar](50) NULL,
7: [UserHostAddress] [nvarchar](50) NULL,
8: [QueryString] [nvarchar](4000) NULL,
9: [Form] [nvarchar](4000) NULL,
10: [RequestParams] [nvarchar](4000) NULL,
11: [InputStreamLength] [int] NULL,
12: [IsAuthenticated] [int] NULL,
13: [IsLocal] [int] NULL,
14: [UserAgent] [nvarchar](4000) NULL,
15: [Headers] [nvarchar](4000) NULL
16: ) ON [PRIMARY]
17:
18: GO
Код, що формує параметри виглядає ось так:
1: Imports Microsoft.VisualBasic
2:
3: Public Class TraceRequest
4: Sub SaveToLog(ByVal sender As Object, ByVal e As System.EventArgs)
5: Dim CN1 As New Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("SQLServer_ConnectionStrings").ConnectionString)
6: Dim InsertTraceCMD As New Data.SqlClient.SqlCommand("AddTraceLog", CN1)
7: CN1.Open()
8: Try
9:
10: InsertTraceCMD.CommandType = Data.CommandType.StoredProcedure
11:
12: InsertTraceCMD.Parameters.AddWithValue("@RawUrl", HttpContext.Current.Request.RawUrl.ToString)
13: If HttpContext.Current.Request.UrlReferrer IsNot Nothing Then
14: InsertTraceCMD.Parameters.AddWithValue("@UrlReferrer", HttpContext.Current.Request.UrlReferrer.ToString)
15: Else
16: InsertTraceCMD.Parameters.AddWithValue("@UrlReferrer", DBNull.Value)
17: End If
18:
19: InsertTraceCMD.Parameters.AddWithValue("@HttpMethod", HttpContext.Current.Request.HttpMethod.ToString)
20: InsertTraceCMD.Parameters.AddWithValue("@UserHostAddress", HttpContext.Current.Request.UserHostAddress.ToString)
21: InsertTraceCMD.Parameters.AddWithValue("@QueryString", HttpContext.Current.Request.QueryString.ToString)
22: InsertTraceCMD.Parameters.AddWithValue("@Form", HttpContext.Current.Request.Form.ToString)
23: InsertTraceCMD.Parameters.AddWithValue("@RequestParams", HttpContext.Current.Request.Params.ToString)
24:
25: InsertTraceCMD.Parameters.AddWithValue("@IsAuthenticated", HttpContext.Current.Request.IsAuthenticated)
26: InsertTraceCMD.Parameters.AddWithValue("@IsLocal", HttpContext.Current.Request.IsLocal)
27: InsertTraceCMD.Parameters.AddWithValue("@UserAgent", HttpContext.Current.Request.UserAgent.ToString)
28: InsertTraceCMD.Parameters.AddWithValue("@Headers", HttpContext.Current.Request.Headers.ToString)
29: If HttpContext.Current.Request.InputStream IsNot Nothing Then
30: InsertTraceCMD.Parameters.AddWithValue("@InputStreamLength", HttpContext.Current.Request.InputStream.Length)
31: Else
32: InsertTraceCMD.Parameters.AddWithValue("@InputStreamLength", 0)
33: End If
34: InsertTraceCMD.ExecuteNonQuery()
35:
36: Catch ex As Exception
37: HttpContext.Current.Response.Write(ex.Message)
38: End Try
39: CN1.Close()
40: End Sub
41:
42:
43: End Class
Тут є важлива крапочка. Оскільки у мене одночасно з трасуванням реквестів працює у базі декілька ось таких тригерів (відображення даних з них я не буду тут описувати),
Але важливим тут є те, що дата у тригерах і тасуваннях повинна корелюватися, тобто дату у трасі треба проставляти процедурою, а не з дати web-серверу.
1: ALTER procedure [dbo].[AddTraceLog]
2:
3: (@RawUrl as nvarchar(1000)
4: ,@UrlReferrer as nvarchar(1000)
5: ,@HttpMethod as nvarchar(50)
6: ,@UserHostAddress as nvarchar(50)
7: ,@QueryString as nvarchar(4000)
8: ,@Form as nvarchar(4000)
9: ,@RequestParams as nvarchar(4000)
10: ,@InputStreamLength as int
11: ,@IsAuthenticated as int
12: ,@IsLocal as int
13: ,@UserAgent as nvarchar(4000)
14: ,@Headers as nvarchar(4000))
15: as
16: INSERT INTO [vOtpusk_Arenda].[dbo].[TraceLog]
17: ([CrDate]
18: ,[RawUrl]
19: ,[UrlReferrer]
20: ,[HttpMethod]
21: ,[UserHostAddress]
22: ,[QueryString]
23: ,[Form]
24: ,[RequestParams]
25: ,[InputStreamLength]
26: ,[IsAuthenticated]
27: ,[IsLocal]
28: ,[UserAgent]
29: ,[Headers])
30: VALUES
31: (GETDATE()
32: ,@RawUrl
33: ,@UrlReferrer
34: ,@HttpMethod
35: ,@UserHostAddress
36: ,@QueryString
37: ,@Form
38: ,@RequestParams
39: ,@InputStreamLength
40: ,@IsAuthenticated
41: ,@IsLocal
42: ,@UserAgent
43: ,@Headers)
44:
45: GO
Але найбільш важливою крапкою у налагодженні трасування є те, що базу треба перевести у режим BULK LOGGED
Разом з тим, що у цієї табличці немає кластерного індексу, можливо досягнути саме те, що при розмірі бази в декілька терабайт сайт все ще працює добре. У моїх обставинах сайт заповнює близько п'ятсот мегов даних трасування за добу. Тобто база стає багато-терабайтною за тиждень - а сайт все ще не тільки працює, але й майже не завищує час відклику.
Дані GET-реквесту накопичуються приблизно такого плану:
111072 2015-07-03 13:59:47.000 /GetFoto.ashx?id=598ec804-6cf1-45c8-bfa8-ea914f2839b2&W=100 http://arenda.votpusk.ru/Object_info_all.aspx?Object=06ae0b8c-2c3d-4b1b-8e29-24d25bc712ee GET 217.118.81.29 id=598ec804-6cf1-45c8-bfa8-ea914f2839b2&W=100
А у POST-реквесту додатково запам'ятовується ще два поля - RequestForm і RequestParams. Десь приблизно ось такого плану:
Тепер, коли мі бачимо - що накопичується і у якому розмірі - зрозуміло, що важливо якось обробляти ці мільйони записів. Для чого ми накопичували ці 12 мільйонів записів, що зайняли у моєму випадку пів-терабайту? Щонайменше потрібна якась обробка цієї сировини - щоб знайти відповіді на свої запитання, заради яких накопичувалися ці терабайти.
Далі я буду розповідати саме про таку прогу, яка обробляє усю цю сировину. Спочатку відбирає потрібні записи, а потім розкодовує потрібні поля і шукає в них те, шо мі шукаємо. Наприклад XSS-атаку, чи якусь причину попадання сайта у неможливе становище, яке не виходить прорахувати логічно у голові.
Моя прога працює таким чином. Спочатку відбирається необхідні записі у базі по такому критерію, що можливо побачити на рівні SQL. Наприклад, на першому скріні я відбираю на рівні SQL такі записи, які я умовно назвав VIRUS.
Відбори по такій великій базі ідуть довго. Дуже довго. Декілька хвилин, щонайменше. Цілком інтерактивну форму, що працює поки іде запит до базі зробити важко, тому я задовольнився тут простою формою очікування.
І ось запит до бази виконався, і ми можемо побачити очима ті самі записи, якими ми зацікавилися на рівні SQL. Теперь мм можемо звузити місце пошуку і шукати очима потрібні записи:
Коли мы знаходимо цікаву запис, то можемо її розкодувати, та зробити над окремими полями інші потрібні операції (тут буде описано лише розкодування з ESCAPE-HTML. Взагалі, у полях POST-реквесту можно що завгодно розкодувати, наприклад далекому 2005-му році мені було потрібно розкодуваті ViewState.
Щодо додаткових вимог до проги, то важливо, щоб вона розтягувалась на весь монітор, бо, як ви бачите на скринах - даних занадто багато і шукати голочку у цілому стогу цього сміття досить важко.
Ну ось мі дійшли до того місця, у якому вже можливо описувати саму прогу. По-перше подивимося, з чого складається увесь цей проєкт. Тут є дві форми, один модуль, один класс і один статично маркований буфер для даних. У ресурсах і сетінгах є ще іконка та ConnectionString до бази.
Тепер я покажу код кожного компонента. Почнемо з основної форми. Тут немає жодних хитрощів. Усе по букварику. Як я вже казав раніше, такий засіб інтерактивності на час запиту до бази не зовсім коректний, але це найбільш простіший засіб із можливих і все одно це краще, ніж форма взагалі підвисає без жодних пояснень.
1: Public Class Form1
2:
3: Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
4: Application.DoEvents()
5: DataGridView1.Enabled = False
6: Me.ComboBox1.Items.Add("Top10")
7: Me.ComboBox1.Items.Add("AllPost")
8: Me.ComboBox1.Items.Add("Virus")
9: Me.TraceLogTableAdapter.SetCommandTimeout(100000)
10: ContextMenuStrip1.Cursor = Cursors.Hand
11:
12: BackgroundWorker1.WorkerSupportsCancellation = True
13: End Sub
14:
15: Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
16: Progress.Show()
17: If Not BackgroundWorker1.IsBusy = True Then
18: BackgroundWorker1.RunWorkerAsync()
19: End If
20: End Sub
21:
22:
23: Private Sub DataGridView1_SelectionChanged(sender As Object, e As System.EventArgs) Handles DataGridView1.SelectionChanged
24: If CType(sender, DataGridView).SelectedRows.Count > 0 Then
25: Dim RowIndex As Integer = CType(sender, DataGridView).SelectedRows(0).Index
26: TextBox_Form.Text = TraceLog_DS.TraceLog.Rows(RowIndex).Item("Form").ToString.Replace("&", vbCrLf & vbCrLf)
27: TextBox_Param.Text = TraceLog_DS.TraceLog.Rows(RowIndex).Item("RequestParams").ToString.Replace("&", vbCrLf & vbCrLf)
28: End If
29: End Sub
30:
31: Private Sub Label3_Click(sender As System.Object, e As System.EventArgs) Handles Label3.Click
32: Dim sInfo As ProcessStartInfo = New ProcessStartInfo("http://unicode.online-toolz.com/tools/text-unicode-entities-convertor.php")
33: Process.Start(sInfo)
34: End Sub
35:
36: Private Sub ToolStripTextBox1_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripTextBox1.Click
37: Select Case CType(CType(sender, ToolStripTextBox).Owner, ContextMenuStrip).SourceControl.Name
38: Case "TextBox_Form"
39: MsgBox(DecodeHTML(TextBox_Form.SelectedText), MsgBoxStyle.OkOnly, "Unicode")
40: Case "TextBox_Param"
41: MsgBox(DecodeHTML(TextBox_Param.SelectedText), MsgBoxStyle.OkOnly, "Unicode")
42: End Select
43: End Sub
44:
45: Private Sub BackgroundWorker1_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
46: Me.Invoke(New MethodInvoker(AddressOf Fill_DS))
47: End Sub
48:
49: Private Sub BackgroundWorker1_RunWorkerCompleted(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
50: Me.Invoke(New MethodInvoker(AddressOf ProgressEnd))
51: End Sub
52:
53:
54: Private Sub Fill_DS()
55: DataGridView1.Enabled = False
56: Me.Button1.Enabled = False
57: Select Case ComboBox1.SelectedItem.ToString
58: Case "Top10"
59: Me.TraceLogTableAdapter.Fill_top10(Me.TraceLog_DS.TraceLog)
60: Case "AllPost"
61: Me.TraceLogTableAdapter.FillByAllPost(Me.TraceLog_DS.TraceLog)
62: Case "Virus"
63: Me.TraceLogTableAdapter.FillByVirus(Me.TraceLog_DS.TraceLog)
64: End Select
65: Me.Button1.Enabled = True
66: DataGridView1.Enabled = True
67: DataGridView1.DataSource = Me.TraceLog_DS.TraceLog
68: End Sub
69:
70: Sub ProgressEnd()
71: If Progress IsNot Nothing AndAlso Progress.Visible Then
72: Progress.Close()
73: End If
74: End Sub
75: End Class
1: <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
2: Partial Class Form1
3: Inherits System.Windows.Forms.Form
4:
5: 'Form overrides dispose to clean up the component list.
6: <System.Diagnostics.DebuggerNonUserCode()> _
7: Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8: Try
9: If disposing AndAlso components IsNot Nothing Then
10: components.Dispose()
11: End If
12: Finally
13: MyBase.Dispose(disposing)
14: End Try
15: End Sub
16:
17: 'Required by the Windows Form Designer
18: Private components As System.ComponentModel.IContainer
19:
20: 'NOTE: The following procedure is required by the Windows Form Designer
21: 'It can be modified using the Windows Form Designer.
22: 'Do not modify it using the code editor.
23: <System.Diagnostics.DebuggerStepThrough()> _
24: Private Sub InitializeComponent()
25: Me.components = New System.ComponentModel.Container()
26: Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
27: Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
28: Me.ToolStripTextBox1 = New System.Windows.Forms.ToolStripTextBox()
29: Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
30: Me.GroupBox1 = New System.Windows.Forms.GroupBox()
31: Me.Label4 = New System.Windows.Forms.Label()
32: Me.ComboBox1 = New System.Windows.Forms.ComboBox()
33: Me.Button1 = New System.Windows.Forms.Button()
34: Me.GroupBox2 = New System.Windows.Forms.GroupBox()
35: Me.TextBox_Form = New System.Windows.Forms.TextBox()
36: Me.GroupBox3 = New System.Windows.Forms.GroupBox()
37: Me.TextBox_Param = New System.Windows.Forms.TextBox()
38: Me.GroupBox4 = New System.Windows.Forms.GroupBox()
39: Me.DataGridView1 = New System.Windows.Forms.DataGridView()
40: Me.IDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
41: Me.CrDateDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
42: Me.RawUrlDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
43: Me.UrlReferrerDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
44: Me.HttpMethodDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
45: Me.UserHostAddressDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
46: Me.QueryStringDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
47: Me.FormDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
48: Me.RequestParamsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
49: Me.InputStreamLengthDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
50: Me.IsAuthenticatedDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
51: Me.IsLocalDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
52: Me.UserAgentDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
53: Me.HeadersDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
54: Me.TraceLogBindingSource = New System.Windows.Forms.BindingSource(Me.components)
55: Me.TraceLog_DS = New Virus.TraceLog_DS()
56: Me.Label3 = New System.Windows.Forms.Label()
57: Me.TraceLogTableAdapter = New Virus.TraceLog_DSTableAdapters.TraceLogTableAdapter()
58: Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker()
59: Me.ContextMenuStrip1.SuspendLayout()
60: Me.TableLayoutPanel1.SuspendLayout()
61: Me.GroupBox1.SuspendLayout()
62: Me.GroupBox2.SuspendLayout()
63: Me.GroupBox3.SuspendLayout()
64: Me.GroupBox4.SuspendLayout()
65: CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
66: CType(Me.TraceLogBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
67: CType(Me.TraceLog_DS, System.ComponentModel.ISupportInitialize).BeginInit()
68: Me.SuspendLayout()
69: '
70: 'ContextMenuStrip1
71: '
72: Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripTextBox1})
73: Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
74: Me.ContextMenuStrip1.Size = New System.Drawing.Size(161, 27)
75: '
76: 'ToolStripTextBox1
77: '
78: Me.ToolStripTextBox1.Name = "ToolStripTextBox1"
79: Me.ToolStripTextBox1.ReadOnly = True
80: Me.ToolStripTextBox1.Size = New System.Drawing.Size(100, 21)
81: Me.ToolStripTextBox1.Text = "UNICODE"
82: '
83: 'TableLayoutPanel1
84: '
85: Me.TableLayoutPanel1.ColumnCount = 1
86: Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
87: Me.TableLayoutPanel1.Controls.Add(Me.GroupBox1, 0, 0)
88: Me.TableLayoutPanel1.Controls.Add(Me.GroupBox2, 0, 2)
89: Me.TableLayoutPanel1.Controls.Add(Me.GroupBox3, 0, 3)
90: Me.TableLayoutPanel1.Controls.Add(Me.GroupBox4, 0, 1)
91: Me.TableLayoutPanel1.Controls.Add(Me.Label3, 0, 4)
92: Me.TableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill
93: Me.TableLayoutPanel1.Location = New System.Drawing.Point(0, 0)
94: Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
95: Me.TableLayoutPanel1.RowCount = 5
96: Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50.0!))
97: Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.48671!))
98: Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.59537!))
99: Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 32.91792!))
100: Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20.0!))
101: Me.TableLayoutPanel1.Size = New System.Drawing.Size(914, 719)
102: Me.TableLayoutPanel1.TabIndex = 11
103: '
104: 'GroupBox1
105: '
106: Me.GroupBox1.Controls.Add(Me.Label4)
107: Me.GroupBox1.Controls.Add(Me.ComboBox1)
108: Me.GroupBox1.Controls.Add(Me.Button1)
109: Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Fill
110: Me.GroupBox1.Location = New System.Drawing.Point(3, 3)
111: Me.GroupBox1.Name = "GroupBox1"
112: Me.GroupBox1.Size = New System.Drawing.Size(908, 44)
113: Me.GroupBox1.TabIndex = 0
114: Me.GroupBox1.TabStop = False
115: '
116: 'Label4
117: '
118: Me.Label4.AutoSize = True
119: Me.Label4.ForeColor = System.Drawing.SystemColors.Desktop
120: Me.Label4.Location = New System.Drawing.Point(9, 14)
121: Me.Label4.Name = "Label4"
122: Me.Label4.Size = New System.Drawing.Size(556, 13)
123: Me.Label4.TabIndex = 10
124: Me.Label4.Text = "Для анализа запросов к сайту сначала выберите запрос в базу, потом конкретный зап" & _
125: "рос в таблице ниже"
126: '
127: 'ComboBox1
128: '
129: Me.ComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
130: Me.ComboBox1.FormattingEnabled = True
131: Me.ComboBox1.Location = New System.Drawing.Point(593, 9)
132: Me.ComboBox1.Name = "ComboBox1"
133: Me.ComboBox1.Size = New System.Drawing.Size(249, 21)
134: Me.ComboBox1.TabIndex = 9
135: '
136: 'Button1
137: '
138: Me.Button1.BackgroundImage = CType(resources.GetObject("Button1.BackgroundImage"), System.Drawing.Image)
139: Me.Button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
140: Me.Button1.Location = New System.Drawing.Point(859, 9)
141: Me.Button1.Name = "Button1"
142: Me.Button1.Size = New System.Drawing.Size(23, 23)
143: Me.Button1.TabIndex = 2
144: Me.Button1.UseVisualStyleBackColor = True
145: '
146: 'GroupBox2
147: '
148: Me.GroupBox2.Controls.Add(Me.TextBox_Form)
149: Me.GroupBox2.Dock = System.Windows.Forms.DockStyle.Fill
150: Me.GroupBox2.ForeColor = System.Drawing.SystemColors.Desktop
151: Me.GroupBox2.Location = New System.Drawing.Point(3, 270)
152: Me.GroupBox2.Name = "GroupBox2"
153: Me.GroupBox2.Size = New System.Drawing.Size(908, 212)
154: Me.GroupBox2.TabIndex = 1
155: Me.GroupBox2.TabStop = False
156: Me.GroupBox2.Text = "RequestForm"
157: '
158: 'TextBox_Form
159: '
160: Me.TextBox_Form.ContextMenuStrip = Me.ContextMenuStrip1
161: Me.TextBox_Form.Dock = System.Windows.Forms.DockStyle.Fill
162: Me.TextBox_Form.Location = New System.Drawing.Point(3, 16)
163: Me.TextBox_Form.Multiline = True
164: Me.TextBox_Form.Name = "TextBox_Form"
165: Me.TextBox_Form.ReadOnly = True
166: Me.TextBox_Form.ScrollBars = System.Windows.Forms.ScrollBars.Both
167: Me.TextBox_Form.Size = New System.Drawing.Size(902, 193)
168: Me.TextBox_Form.TabIndex = 13
169: '
170: 'GroupBox3
171: '
172: Me.GroupBox3.Controls.Add(Me.TextBox_Param)
173: Me.GroupBox3.Dock = System.Windows.Forms.DockStyle.Fill
174: Me.GroupBox3.ForeColor = System.Drawing.SystemColors.Desktop
175: Me.GroupBox3.Location = New System.Drawing.Point(3, 488)
176: Me.GroupBox3.Name = "GroupBox3"
177: Me.GroupBox3.Size = New System.Drawing.Size(908, 207)
178: Me.GroupBox3.TabIndex = 2
179: Me.GroupBox3.TabStop = False
180: Me.GroupBox3.Text = "RequestParams"
181: '
182: 'TextBox_Param
183: '
184: Me.TextBox_Param.ContextMenuStrip = Me.ContextMenuStrip1
185: Me.TextBox_Param.Dock = System.Windows.Forms.DockStyle.Fill
186: Me.TextBox_Param.Location = New System.Drawing.Point(3, 16)
187: Me.TextBox_Param.Multiline = True
188: Me.TextBox_Param.Name = "TextBox_Param"
189: Me.TextBox_Param.ReadOnly = True
190: Me.TextBox_Param.ScrollBars = System.Windows.Forms.ScrollBars.Both
191: Me.TextBox_Param.Size = New System.Drawing.Size(902, 188)
192: Me.TextBox_Param.TabIndex = 15
193: '
194: 'GroupBox4
195: '
196: Me.GroupBox4.Controls.Add(Me.DataGridView1)
197: Me.GroupBox4.Dock = System.Windows.Forms.DockStyle.Fill
198: Me.GroupBox4.ForeColor = System.Drawing.SystemColors.Desktop
199: Me.GroupBox4.Location = New System.Drawing.Point(3, 53)
200: Me.GroupBox4.Name = "GroupBox4"
201: Me.GroupBox4.Size = New System.Drawing.Size(908, 211)
202: Me.GroupBox4.TabIndex = 3
203: Me.GroupBox4.TabStop = False
204: Me.GroupBox4.Text = "POST-запросы к сайту"
205: '
206: 'DataGridView1
207: '
208: Me.DataGridView1.AutoGenerateColumns = False
209: Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
210: Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDataGridViewTextBoxColumn, Me.CrDateDataGridViewTextBoxColumn, Me.RawUrlDataGridViewTextBoxColumn, Me.UrlReferrerDataGridViewTextBoxColumn, Me.HttpMethodDataGridViewTextBoxColumn, Me.UserHostAddressDataGridViewTextBoxColumn, Me.QueryStringDataGridViewTextBoxColumn, Me.FormDataGridViewTextBoxColumn, Me.RequestParamsDataGridViewTextBoxColumn, Me.InputStreamLengthDataGridViewTextBoxColumn, Me.IsAuthenticatedDataGridViewTextBoxColumn, Me.IsLocalDataGridViewTextBoxColumn, Me.UserAgentDataGridViewTextBoxColumn, Me.HeadersDataGridViewTextBoxColumn})
211: Me.DataGridView1.Cursor = System.Windows.Forms.Cursors.Hand
212: Me.DataGridView1.DataSource = Me.TraceLogBindingSource
213: Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill
214: Me.DataGridView1.GridColor = System.Drawing.SystemColors.InactiveBorder
215: Me.DataGridView1.Location = New System.Drawing.Point(3, 16)
216: Me.DataGridView1.MultiSelect = False
217: Me.DataGridView1.Name = "DataGridView1"
218: Me.DataGridView1.ReadOnly = True
219: Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect
220: Me.DataGridView1.Size = New System.Drawing.Size(902, 192)
221: Me.DataGridView1.TabIndex = 8
222: '
223: 'IDataGridViewTextBoxColumn
224: '
225: Me.IDataGridViewTextBoxColumn.DataPropertyName = "i"
226: Me.IDataGridViewTextBoxColumn.HeaderText = "i"
227: Me.IDataGridViewTextBoxColumn.Name = "IDataGridViewTextBoxColumn"
228: Me.IDataGridViewTextBoxColumn.ReadOnly = True
229: '
230: 'CrDateDataGridViewTextBoxColumn
231: '
232: Me.CrDateDataGridViewTextBoxColumn.DataPropertyName = "CrDate"
233: Me.CrDateDataGridViewTextBoxColumn.HeaderText = "CrDate"
234: Me.CrDateDataGridViewTextBoxColumn.Name = "CrDateDataGridViewTextBoxColumn"
235: Me.CrDateDataGridViewTextBoxColumn.ReadOnly = True
236: '
237: 'RawUrlDataGridViewTextBoxColumn
238: '
239: Me.RawUrlDataGridViewTextBoxColumn.DataPropertyName = "RawUrl"
240: Me.RawUrlDataGridViewTextBoxColumn.HeaderText = "RawUrl"
241: Me.RawUrlDataGridViewTextBoxColumn.Name = "RawUrlDataGridViewTextBoxColumn"
242: Me.RawUrlDataGridViewTextBoxColumn.ReadOnly = True
243: '
244: 'UrlReferrerDataGridViewTextBoxColumn
245: '
246: Me.UrlReferrerDataGridViewTextBoxColumn.DataPropertyName = "UrlReferrer"
247: Me.UrlReferrerDataGridViewTextBoxColumn.HeaderText = "UrlReferrer"
248: Me.UrlReferrerDataGridViewTextBoxColumn.Name = "UrlReferrerDataGridViewTextBoxColumn"
249: Me.UrlReferrerDataGridViewTextBoxColumn.ReadOnly = True
250: '
251: 'HttpMethodDataGridViewTextBoxColumn
252: '
253: Me.HttpMethodDataGridViewTextBoxColumn.DataPropertyName = "HttpMethod"
254: Me.HttpMethodDataGridViewTextBoxColumn.HeaderText = "HttpMethod"
255: Me.HttpMethodDataGridViewTextBoxColumn.Name = "HttpMethodDataGridViewTextBoxColumn"
256: Me.HttpMethodDataGridViewTextBoxColumn.ReadOnly = True
257: '
258: 'UserHostAddressDataGridViewTextBoxColumn
259: '
260: Me.UserHostAddressDataGridViewTextBoxColumn.DataPropertyName = "UserHostAddress"
261: Me.UserHostAddressDataGridViewTextBoxColumn.HeaderText = "UserHostAddress"
262: Me.UserHostAddressDataGridViewTextBoxColumn.Name = "UserHostAddressDataGridViewTextBoxColumn"
263: Me.UserHostAddressDataGridViewTextBoxColumn.ReadOnly = True
264: '
265: 'QueryStringDataGridViewTextBoxColumn
266: '
267: Me.QueryStringDataGridViewTextBoxColumn.DataPropertyName = "QueryString"
268: Me.QueryStringDataGridViewTextBoxColumn.HeaderText = "QueryString"
269: Me.QueryStringDataGridViewTextBoxColumn.Name = "QueryStringDataGridViewTextBoxColumn"
270: Me.QueryStringDataGridViewTextBoxColumn.ReadOnly = True
271: '
272: 'FormDataGridViewTextBoxColumn
273: '
274: Me.FormDataGridViewTextBoxColumn.DataPropertyName = "Form"
275: Me.FormDataGridViewTextBoxColumn.HeaderText = "Form"
276: Me.FormDataGridViewTextBoxColumn.Name = "FormDataGridViewTextBoxColumn"
277: Me.FormDataGridViewTextBoxColumn.ReadOnly = True
278: '
279: 'RequestParamsDataGridViewTextBoxColumn
280: '
281: Me.RequestParamsDataGridViewTextBoxColumn.DataPropertyName = "RequestParams"
282: Me.RequestParamsDataGridViewTextBoxColumn.HeaderText = "RequestParams"
283: Me.RequestParamsDataGridViewTextBoxColumn.Name = "RequestParamsDataGridViewTextBoxColumn"
284: Me.RequestParamsDataGridViewTextBoxColumn.ReadOnly = True
285: '
286: 'InputStreamLengthDataGridViewTextBoxColumn
287: '
288: Me.InputStreamLengthDataGridViewTextBoxColumn.DataPropertyName = "InputStreamLength"
289: Me.InputStreamLengthDataGridViewTextBoxColumn.HeaderText = "InputStreamLength"
290: Me.InputStreamLengthDataGridViewTextBoxColumn.Name = "InputStreamLengthDataGridViewTextBoxColumn"
291: Me.InputStreamLengthDataGridViewTextBoxColumn.ReadOnly = True
292: '
293: 'IsAuthenticatedDataGridViewTextBoxColumn
294: '
295: Me.IsAuthenticatedDataGridViewTextBoxColumn.DataPropertyName = "IsAuthenticated"
296: Me.IsAuthenticatedDataGridViewTextBoxColumn.HeaderText = "IsAuthenticated"
297: Me.IsAuthenticatedDataGridViewTextBoxColumn.Name = "IsAuthenticatedDataGridViewTextBoxColumn"
298: Me.IsAuthenticatedDataGridViewTextBoxColumn.ReadOnly = True
299: '
300: 'IsLocalDataGridViewTextBoxColumn
301: '
302: Me.IsLocalDataGridViewTextBoxColumn.DataPropertyName = "IsLocal"
303: Me.IsLocalDataGridViewTextBoxColumn.HeaderText = "IsLocal"
304: Me.IsLocalDataGridViewTextBoxColumn.Name = "IsLocalDataGridViewTextBoxColumn"
305: Me.IsLocalDataGridViewTextBoxColumn.ReadOnly = True
306: '
307: 'UserAgentDataGridViewTextBoxColumn
308: '
309: Me.UserAgentDataGridViewTextBoxColumn.DataPropertyName = "UserAgent"
310: Me.UserAgentDataGridViewTextBoxColumn.HeaderText = "UserAgent"
311: Me.UserAgentDataGridViewTextBoxColumn.Name = "UserAgentDataGridViewTextBoxColumn"
312: Me.UserAgentDataGridViewTextBoxColumn.ReadOnly = True
313: '
314: 'HeadersDataGridViewTextBoxColumn
315: '
316: Me.HeadersDataGridViewTextBoxColumn.DataPropertyName = "Headers"
317: Me.HeadersDataGridViewTextBoxColumn.HeaderText = "Headers"
318: Me.HeadersDataGridViewTextBoxColumn.Name = "HeadersDataGridViewTextBoxColumn"
319: Me.HeadersDataGridViewTextBoxColumn.ReadOnly = True
320: '
321: 'TraceLogBindingSource
322: '
323: Me.TraceLogBindingSource.DataMember = "TraceLog"
324: Me.TraceLogBindingSource.DataSource = Me.TraceLog_DS
325: '
326: 'TraceLog_DS
327: '
328: Me.TraceLog_DS.DataSetName = "TraceLog_DS"
329: Me.TraceLog_DS.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
330: '
331: 'Label3
332: '
333: Me.Label3.AutoSize = True
334: Me.Label3.Cursor = System.Windows.Forms.Cursors.Hand
335: Me.Label3.Dock = System.Windows.Forms.DockStyle.Fill
336: Me.Label3.ForeColor = System.Drawing.SystemColors.Desktop
337: Me.Label3.Location = New System.Drawing.Point(3, 698)
338: Me.Label3.Name = "Label3"
339: Me.Label3.Size = New System.Drawing.Size(908, 21)
340: Me.Label3.TabIndex = 11
341: Me.Label3.Text = "Для просмотра в UNICODE выделите текст, щелкните правой кнопкой мышки и выберите " & _
342: "- UNICODE или кликните здесь, чтобы воспользоваться онлайн-инструментами"
343: '
344: 'TraceLogTableAdapter
345: '
346: Me.TraceLogTableAdapter.ClearBeforeFill = True
347: '
348: 'BackgroundWorker1
349: '
350: '
351: 'Form1
352: '
353: Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
354: Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
355: Me.ClientSize = New System.Drawing.Size(914, 719)
356: Me.Controls.Add(Me.TableLayoutPanel1)
357: Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
358: Me.Name = "Form1"
359: Me.Text = "Arenda Antivirus (парсер POST-запросов к сайту)"
360: Me.ContextMenuStrip1.ResumeLayout(False)
361: Me.ContextMenuStrip1.PerformLayout()
362: Me.TableLayoutPanel1.ResumeLayout(False)
363: Me.TableLayoutPanel1.PerformLayout()
364: Me.GroupBox1.ResumeLayout(False)
365: Me.GroupBox1.PerformLayout()
366: Me.GroupBox2.ResumeLayout(False)
367: Me.GroupBox2.PerformLayout()
368: Me.GroupBox3.ResumeLayout(False)
369: Me.GroupBox3.PerformLayout()
370: Me.GroupBox4.ResumeLayout(False)
371: CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
372: CType(Me.TraceLogBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
373: CType(Me.TraceLog_DS, System.ComponentModel.ISupportInitialize).EndInit()
374: Me.ResumeLayout(False)
375:
376: End Sub
377: Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip
378: Friend WithEvents ToolStripTextBox1 As System.Windows.Forms.ToolStripTextBox
379: Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
380: Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
381: Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
382: Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
383: Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox
384: Friend WithEvents Button1 As System.Windows.Forms.Button
385: Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
386: Friend WithEvents Label4 As System.Windows.Forms.Label
387: Friend WithEvents TextBox_Form As System.Windows.Forms.TextBox
388: Friend WithEvents TextBox_Param As System.Windows.Forms.TextBox
389: Friend WithEvents Label3 As System.Windows.Forms.Label
390: Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView
391: Friend WithEvents TraceLog_DS As Virus.TraceLog_DS
392: Friend WithEvents TraceLogBindingSource As System.Windows.Forms.BindingSource
393: Friend WithEvents TraceLogTableAdapter As Virus.TraceLog_DSTableAdapters.TraceLogTableAdapter
394: Friend WithEvents IDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
395: Friend WithEvents CrDateDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
396: Friend WithEvents RawUrlDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
397: Friend WithEvents UrlReferrerDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
398: Friend WithEvents HttpMethodDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
399: Friend WithEvents UserHostAddressDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
400: Friend WithEvents QueryStringDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
401: Friend WithEvents FormDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
402: Friend WithEvents RequestParamsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
403: Friend WithEvents InputStreamLengthDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
404: Friend WithEvents IsAuthenticatedDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
405: Friend WithEvents IsLocalDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
406: Friend WithEvents UserAgentDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
407: Friend WithEvents HeadersDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
408: Friend WithEvents BackgroundWorker1 As System.ComponentModel.BackgroundWorker
409:
410: End Class
Далі та сама маленька форма, яка не дуже інтерактивно працює, але це все одно краще, ниж нічого.
1: Imports System.Windows.Forms
2:
3: Public Class Progress
4:
5: Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
6: Me.DialogResult = System.Windows.Forms.DialogResult.OK
7: Me.Close()
8: End Sub
9:
10: Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
11: Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
12: Me.Close()
13: End Sub
14:
15: End Class
1: <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
2: Partial Class Progress
3: Inherits System.Windows.Forms.Form
4:
5: 'Form overrides dispose to clean up the component list.
6: <System.Diagnostics.DebuggerNonUserCode()> _
7: Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8: Try
9: If disposing AndAlso components IsNot Nothing Then
10: components.Dispose()
11: End If
12: Finally
13: MyBase.Dispose(disposing)
14: End Try
15: End Sub
16:
17: 'Required by the Windows Form Designer
18: Private components As System.ComponentModel.IContainer
19:
20: 'NOTE: The following procedure is required by the Windows Form Designer
21: 'It can be modified using the Windows Form Designer.
22: 'Do not modify it using the code editor.
23: <System.Diagnostics.DebuggerStepThrough()> _
24: Private Sub InitializeComponent()
25: Me.ProgressBar1 = New System.Windows.Forms.ProgressBar()
26: Me.SuspendLayout()
27: '
28: 'ProgressBar1
29: '
30: Me.ProgressBar1.Dock = System.Windows.Forms.DockStyle.Fill
31: Me.ProgressBar1.Location = New System.Drawing.Point(0, 0)
32: Me.ProgressBar1.Name = "ProgressBar1"
33: Me.ProgressBar1.Size = New System.Drawing.Size(435, 56)
34: Me.ProgressBar1.Style = System.Windows.Forms.ProgressBarStyle.Marquee
35: Me.ProgressBar1.TabIndex = 0
36: '
37: 'Progress
38: '
39: Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
40: Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
41: Me.ClientSize = New System.Drawing.Size(435, 56)
42: Me.Controls.Add(Me.ProgressBar1)
43: Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
44: Me.MaximizeBox = False
45: Me.MinimizeBox = False
46: Me.Name = "Progress"
47: Me.ShowInTaskbar = False
48: Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
49: Me.Text = "Waiting"
50: Me.TopMost = True
51: Me.ResumeLayout(False)
52:
53: End Sub
54: Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar
55:
56: End Class
Далі той самий форматований буфер для даних, що так просто формується Студією (лише одним drag-and-drop'ом) але займає так багато коду:
1: '------------------------------------------------------------------------------
2: ' <auto-generated>
3: ' This code was generated by a tool.
4: ' Runtime Version:4.0.30319.34209
5: '
6: ' Changes to this file may cause incorrect behavior and will be lost if
7: ' the code is regenerated.
8: ' </auto-generated>
9: '------------------------------------------------------------------------------
10:
11: Option Strict Off
12: Option Explicit On
13:
14:
15:
16: '''<summary>
17: '''Represents a strongly typed in-memory cache of data.
18: '''</summary>
19: <Global.System.Serializable(), _
20: Global.System.ComponentModel.DesignerCategoryAttribute("code"), _
21: Global.System.ComponentModel.ToolboxItem(true), _
22: Global.System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema"), _
23: Global.System.Xml.Serialization.XmlRootAttribute("TraceLog_DS"), _
24: Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")> _
25: Partial Public Class TraceLog_DS
26: Inherits Global.System.Data.DataSet
27:
28: Private tableTraceLog As TraceLogDataTable
29:
30: Private _schemaSerializationMode As Global.System.Data.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema
31:
32: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
33: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
34: Public Sub New()
35: MyBase.New
36: Me.BeginInit
37: Me.InitClass
38: Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged
39: AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler
40: AddHandler MyBase.Relations.CollectionChanged, schemaChangedHandler
41: Me.EndInit
42: End Sub
43:
44: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
45: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
46: Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext)
47: MyBase.New(info, context, false)
48: If (Me.IsBinarySerialized(info, context) = true) Then
49: Me.InitVars(false)
50: Dim schemaChangedHandler1 As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged
51: AddHandler Me.Tables.CollectionChanged, schemaChangedHandler1
52: AddHandler Me.Relations.CollectionChanged, schemaChangedHandler1
53: Return
54: End If
55: Dim strSchema As String = CType(info.GetValue("XmlSchema", GetType(String)),String)
56: If (Me.DetermineSchemaSerializationMode(info, context) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then
57: Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet()
58: ds.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema)))
59: If (Not (ds.Tables("TraceLog")) Is Nothing) Then
60: MyBase.Tables.Add(New TraceLogDataTable(ds.Tables("TraceLog")))
61: End If
62: Me.DataSetName = ds.DataSetName
63: Me.Prefix = ds.Prefix
64: Me.Namespace = ds.Namespace
65: Me.Locale = ds.Locale
66: Me.CaseSensitive = ds.CaseSensitive
67: Me.EnforceConstraints = ds.EnforceConstraints
68: Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add)
69: Me.InitVars
70: Else
71: Me.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema)))
72: End If
73: Me.GetSerializationData(info, context)
74: Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged
75: AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler
76: AddHandler Me.Relations.CollectionChanged, schemaChangedHandler
77: End Sub
78:
79: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
80: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
81: Global.System.ComponentModel.Browsable(false), _
82: Global.System.ComponentModel.DesignerSerializationVisibility(Global.System.ComponentModel.DesignerSerializationVisibility.Content)> _
83: Public ReadOnly Property TraceLog() As TraceLogDataTable
84: Get
85: Return Me.tableTraceLog
86: End Get
87: End Property
88:
89: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
90: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
91: Global.System.ComponentModel.BrowsableAttribute(true), _
92: Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Visible)> _
93: Public Overrides Property SchemaSerializationMode() As Global.System.Data.SchemaSerializationMode
94: Get
95: Return Me._schemaSerializationMode
96: End Get
97: Set
98: Me._schemaSerializationMode = value
99: End Set
100: End Property
101:
102: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
103: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
104: Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Hidden)> _
105: Public Shadows ReadOnly Property Tables() As Global.System.Data.DataTableCollection
106: Get
107: Return MyBase.Tables
108: End Get
109: End Property
110:
111: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
112: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
113: Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Hidden)> _
114: Public Shadows ReadOnly Property Relations() As Global.System.Data.DataRelationCollection
115: Get
116: Return MyBase.Relations
117: End Get
118: End Property
119:
120: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
121: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
122: Protected Overrides Sub InitializeDerivedDataSet()
123: Me.BeginInit
124: Me.InitClass
125: Me.EndInit
126: End Sub
127:
128: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
129: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
130: Public Overrides Function Clone() As Global.System.Data.DataSet
131: Dim cln As TraceLog_DS = CType(MyBase.Clone,TraceLog_DS)
132: cln.InitVars
133: cln.SchemaSerializationMode = Me.SchemaSerializationMode
134: Return cln
135: End Function
136:
137: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
138: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
139: Protected Overrides Function ShouldSerializeTables() As Boolean
140: Return false
141: End Function
142:
143: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
144: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
145: Protected Overrides Function ShouldSerializeRelations() As Boolean
146: Return false
147: End Function
148:
149: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
150: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
151: Protected Overrides Sub ReadXmlSerializable(ByVal reader As Global.System.Xml.XmlReader)
152: If (Me.DetermineSchemaSerializationMode(reader) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then
153: Me.Reset
154: Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet()
155: ds.ReadXml(reader)
156: If (Not (ds.Tables("TraceLog")) Is Nothing) Then
157: MyBase.Tables.Add(New TraceLogDataTable(ds.Tables("TraceLog")))
158: End If
159: Me.DataSetName = ds.DataSetName
160: Me.Prefix = ds.Prefix
161: Me.Namespace = ds.Namespace
162: Me.Locale = ds.Locale
163: Me.CaseSensitive = ds.CaseSensitive
164: Me.EnforceConstraints = ds.EnforceConstraints
165: Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add)
166: Me.InitVars
167: Else
168: Me.ReadXml(reader)
169: Me.InitVars
170: End If
171: End Sub
172:
173: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
174: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
175: Protected Overrides Function GetSchemaSerializable() As Global.System.Xml.Schema.XmlSchema
176: Dim stream As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
177: Me.WriteXmlSchema(New Global.System.Xml.XmlTextWriter(stream, Nothing))
178: stream.Position = 0
179: Return Global.System.Xml.Schema.XmlSchema.Read(New Global.System.Xml.XmlTextReader(stream), Nothing)
180: End Function
181:
182: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
183: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
184: Friend Overloads Sub InitVars()
185: Me.InitVars(true)
186: End Sub
187:
188: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
189: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
190: Friend Overloads Sub InitVars(ByVal initTable As Boolean)
191: Me.tableTraceLog = CType(MyBase.Tables("TraceLog"),TraceLogDataTable)
192: If (initTable = true) Then
193: If (Not (Me.tableTraceLog) Is Nothing) Then
194: Me.tableTraceLog.InitVars
195: End If
196: End If
197: End Sub
198:
199: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
200: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
201: Private Sub InitClass()
202: Me.DataSetName = "TraceLog_DS"
203: Me.Prefix = ""
204: Me.Namespace = "http://tempuri.org/TraceLog_DS.xsd"
205: Me.EnforceConstraints = true
206: Me.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema
207: Me.tableTraceLog = New TraceLogDataTable()
208: MyBase.Tables.Add(Me.tableTraceLog)
209: End Sub
210:
211: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
212: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
213: Private Function ShouldSerializeTraceLog() As Boolean
214: Return false
215: End Function
216:
217: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
218: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
219: Private Sub SchemaChanged(ByVal sender As Object, ByVal e As Global.System.ComponentModel.CollectionChangeEventArgs)
220: If (e.Action = Global.System.ComponentModel.CollectionChangeAction.Remove) Then
221: Me.InitVars
222: End If
223: End Sub
224:
225: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
226: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
227: Public Shared Function GetTypedDataSetSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType
228: Dim ds As TraceLog_DS = New TraceLog_DS()
229: Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType()
230: Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence()
231: Dim any As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
232: any.Namespace = ds.Namespace
233: sequence.Items.Add(any)
234: type.Particle = sequence
235: Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable
236: If xs.Contains(dsSchema.TargetNamespace) Then
237: Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
238: Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
239: Try
240: Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing
241: dsSchema.Write(s1)
242: Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator
243: Do While schemas.MoveNext
244: schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema)
245: s2.SetLength(0)
246: schema.Write(s2)
247: If (s1.Length = s2.Length) Then
248: s1.Position = 0
249: s2.Position = 0
250:
251: Do While ((s1.Position <> s1.Length) _
252: AndAlso (s1.ReadByte = s2.ReadByte))
253:
254:
255: Loop
256: If (s1.Position = s1.Length) Then
257: Return type
258: End If
259: End If
260:
261: Loop
262: Finally
263: If (Not (s1) Is Nothing) Then
264: s1.Close
265: End If
266: If (Not (s2) Is Nothing) Then
267: s2.Close
268: End If
269: End Try
270: End If
271: xs.Add(dsSchema)
272: Return type
273: End Function
274:
275: <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
276: Public Delegate Sub TraceLogRowChangeEventHandler(ByVal sender As Object, ByVal e As TraceLogRowChangeEvent)
277:
278: '''<summary>
279: '''Represents the strongly named DataTable class.
280: '''</summary>
281: <Global.System.Serializable(), _
282: Global.System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")> _
283: Partial Public Class TraceLogDataTable
284: Inherits Global.System.Data.TypedTableBase(Of TraceLogRow)
285:
286: Private columni As Global.System.Data.DataColumn
287:
288: Private columnCrDate As Global.System.Data.DataColumn
289:
290: Private columnRawUrl As Global.System.Data.DataColumn
291:
292: Private columnUrlReferrer As Global.System.Data.DataColumn
293:
294: Private columnHttpMethod As Global.System.Data.DataColumn
295:
296: Private columnUserHostAddress As Global.System.Data.DataColumn
297:
298: Private columnQueryString As Global.System.Data.DataColumn
299:
300: Private columnForm As Global.System.Data.DataColumn
301:
302: Private columnRequestParams As Global.System.Data.DataColumn
303:
304: Private columnInputStreamLength As Global.System.Data.DataColumn
305:
306: Private columnIsAuthenticated As Global.System.Data.DataColumn
307:
308: Private columnIsLocal As Global.System.Data.DataColumn
309:
310: Private columnUserAgent As Global.System.Data.DataColumn
311:
312: Private columnHeaders As Global.System.Data.DataColumn
313:
314: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
315: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
316: Public Sub New()
317: MyBase.New
318: Me.TableName = "TraceLog"
319: Me.BeginInit
320: Me.InitClass
321: Me.EndInit
322: End Sub
323:
324: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
325: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
326: Friend Sub New(ByVal table As Global.System.Data.DataTable)
327: MyBase.New
328: Me.TableName = table.TableName
329: If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then
330: Me.CaseSensitive = table.CaseSensitive
331: End If
332: If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then
333: Me.Locale = table.Locale
334: End If
335: If (table.Namespace <> table.DataSet.Namespace) Then
336: Me.Namespace = table.Namespace
337: End If
338: Me.Prefix = table.Prefix
339: Me.MinimumCapacity = table.MinimumCapacity
340: End Sub
341:
342: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
343: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
344: Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext)
345: MyBase.New(info, context)
346: Me.InitVars
347: End Sub
348:
349: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
350: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
351: Public ReadOnly Property iColumn() As Global.System.Data.DataColumn
352: Get
353: Return Me.columni
354: End Get
355: End Property
356:
357: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
358: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
359: Public ReadOnly Property CrDateColumn() As Global.System.Data.DataColumn
360: Get
361: Return Me.columnCrDate
362: End Get
363: End Property
364:
365: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
366: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
367: Public ReadOnly Property RawUrlColumn() As Global.System.Data.DataColumn
368: Get
369: Return Me.columnRawUrl
370: End Get
371: End Property
372:
373: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
374: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
375: Public ReadOnly Property UrlReferrerColumn() As Global.System.Data.DataColumn
376: Get
377: Return Me.columnUrlReferrer
378: End Get
379: End Property
380:
381: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
382: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
383: Public ReadOnly Property HttpMethodColumn() As Global.System.Data.DataColumn
384: Get
385: Return Me.columnHttpMethod
386: End Get
387: End Property
388:
389: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
390: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
391: Public ReadOnly Property UserHostAddressColumn() As Global.System.Data.DataColumn
392: Get
393: Return Me.columnUserHostAddress
394: End Get
395: End Property
396:
397: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
398: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
399: Public ReadOnly Property QueryStringColumn() As Global.System.Data.DataColumn
400: Get
401: Return Me.columnQueryString
402: End Get
403: End Property
404:
405: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
406: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
407: Public ReadOnly Property FormColumn() As Global.System.Data.DataColumn
408: Get
409: Return Me.columnForm
410: End Get
411: End Property
412:
413: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
414: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
415: Public ReadOnly Property RequestParamsColumn() As Global.System.Data.DataColumn
416: Get
417: Return Me.columnRequestParams
418: End Get
419: End Property
420:
421: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
422: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
423: Public ReadOnly Property InputStreamLengthColumn() As Global.System.Data.DataColumn
424: Get
425: Return Me.columnInputStreamLength
426: End Get
427: End Property
428:
429: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
430: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
431: Public ReadOnly Property IsAuthenticatedColumn() As Global.System.Data.DataColumn
432: Get
433: Return Me.columnIsAuthenticated
434: End Get
435: End Property
436:
437: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
438: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
439: Public ReadOnly Property IsLocalColumn() As Global.System.Data.DataColumn
440: Get
441: Return Me.columnIsLocal
442: End Get
443: End Property
444:
445: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
446: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
447: Public ReadOnly Property UserAgentColumn() As Global.System.Data.DataColumn
448: Get
449: Return Me.columnUserAgent
450: End Get
451: End Property
452:
453: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
454: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
455: Public ReadOnly Property HeadersColumn() As Global.System.Data.DataColumn
456: Get
457: Return Me.columnHeaders
458: End Get
459: End Property
460:
461: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
462: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
463: Global.System.ComponentModel.Browsable(false)> _
464: Public ReadOnly Property Count() As Integer
465: Get
466: Return Me.Rows.Count
467: End Get
468: End Property
469:
470: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
471: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
472: Public Default ReadOnly Property Item(ByVal index As Integer) As TraceLogRow
473: Get
474: Return CType(Me.Rows(index),TraceLogRow)
475: End Get
476: End Property
477:
478: <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
479: Public Event TraceLogRowChanging As TraceLogRowChangeEventHandler
480:
481: <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
482: Public Event TraceLogRowChanged As TraceLogRowChangeEventHandler
483:
484: <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
485: Public Event TraceLogRowDeleting As TraceLogRowChangeEventHandler
486:
487: <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
488: Public Event TraceLogRowDeleted As TraceLogRowChangeEventHandler
489:
490: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
491: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
492: Public Overloads Sub AddTraceLogRow(ByVal row As TraceLogRow)
493: Me.Rows.Add(row)
494: End Sub
495:
496: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
497: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
498: Public Overloads Function AddTraceLogRow(ByVal CrDate As Date, ByVal RawUrl As String, ByVal UrlReferrer As String, ByVal HttpMethod As String, ByVal UserHostAddress As String, ByVal QueryString As String, ByVal Form As String, ByVal RequestParams As String, ByVal InputStreamLength As Integer, ByVal IsAuthenticated As Integer, ByVal IsLocal As Integer, ByVal UserAgent As String, ByVal Headers As String) As TraceLogRow
499: Dim rowTraceLogRow As TraceLogRow = CType(Me.NewRow,TraceLogRow)
500: Dim columnValuesArray() As Object = New Object() {Nothing, CrDate, RawUrl, UrlReferrer, HttpMethod, UserHostAddress, QueryString, Form, RequestParams, InputStreamLength, IsAuthenticated, IsLocal, UserAgent, Headers}
501: rowTraceLogRow.ItemArray = columnValuesArray
502: Me.Rows.Add(rowTraceLogRow)
503: Return rowTraceLogRow
504: End Function
505:
506: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
507: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
508: Public Function FindByi(ByVal i As Integer) As TraceLogRow
509: Return CType(Me.Rows.Find(New Object() {i}),TraceLogRow)
510: End Function
511:
512: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
513: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
514: Public Overrides Function Clone() As Global.System.Data.DataTable
515: Dim cln As TraceLogDataTable = CType(MyBase.Clone,TraceLogDataTable)
516: cln.InitVars
517: Return cln
518: End Function
519:
520: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
521: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
522: Protected Overrides Function CreateInstance() As Global.System.Data.DataTable
523: Return New TraceLogDataTable()
524: End Function
525:
526: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
527: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
528: Friend Sub InitVars()
529: Me.columni = MyBase.Columns("i")
530: Me.columnCrDate = MyBase.Columns("CrDate")
531: Me.columnRawUrl = MyBase.Columns("RawUrl")
532: Me.columnUrlReferrer = MyBase.Columns("UrlReferrer")
533: Me.columnHttpMethod = MyBase.Columns("HttpMethod")
534: Me.columnUserHostAddress = MyBase.Columns("UserHostAddress")
535: Me.columnQueryString = MyBase.Columns("QueryString")
536: Me.columnForm = MyBase.Columns("Form")
537: Me.columnRequestParams = MyBase.Columns("RequestParams")
538: Me.columnInputStreamLength = MyBase.Columns("InputStreamLength")
539: Me.columnIsAuthenticated = MyBase.Columns("IsAuthenticated")
540: Me.columnIsLocal = MyBase.Columns("IsLocal")
541: Me.columnUserAgent = MyBase.Columns("UserAgent")
542: Me.columnHeaders = MyBase.Columns("Headers")
543: End Sub
544:
545: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
546: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
547: Private Sub InitClass()
548: Me.columni = New Global.System.Data.DataColumn("i", GetType(Integer), Nothing, Global.System.Data.MappingType.Element)
549: MyBase.Columns.Add(Me.columni)
550: Me.columnCrDate = New Global.System.Data.DataColumn("CrDate", GetType(Date), Nothing, Global.System.Data.MappingType.Element)
551: MyBase.Columns.Add(Me.columnCrDate)
552: Me.columnRawUrl = New Global.System.Data.DataColumn("RawUrl", GetType(String), Nothing, Global.System.Data.MappingType.Element)
553: MyBase.Columns.Add(Me.columnRawUrl)
554: Me.columnUrlReferrer = New Global.System.Data.DataColumn("UrlReferrer", GetType(String), Nothing, Global.System.Data.MappingType.Element)
555: MyBase.Columns.Add(Me.columnUrlReferrer)
556: Me.columnHttpMethod = New Global.System.Data.DataColumn("HttpMethod", GetType(String), Nothing, Global.System.Data.MappingType.Element)
557: MyBase.Columns.Add(Me.columnHttpMethod)
558: Me.columnUserHostAddress = New Global.System.Data.DataColumn("UserHostAddress", GetType(String), Nothing, Global.System.Data.MappingType.Element)
559: MyBase.Columns.Add(Me.columnUserHostAddress)
560: Me.columnQueryString = New Global.System.Data.DataColumn("QueryString", GetType(String), Nothing, Global.System.Data.MappingType.Element)
561: MyBase.Columns.Add(Me.columnQueryString)
562: Me.columnForm = New Global.System.Data.DataColumn("Form", GetType(String), Nothing, Global.System.Data.MappingType.Element)
563: MyBase.Columns.Add(Me.columnForm)
564: Me.columnRequestParams = New Global.System.Data.DataColumn("RequestParams", GetType(String), Nothing, Global.System.Data.MappingType.Element)
565: MyBase.Columns.Add(Me.columnRequestParams)
566: Me.columnInputStreamLength = New Global.System.Data.DataColumn("InputStreamLength", GetType(Integer), Nothing, Global.System.Data.MappingType.Element)
567: MyBase.Columns.Add(Me.columnInputStreamLength)
568: Me.columnIsAuthenticated = New Global.System.Data.DataColumn("IsAuthenticated", GetType(Integer), Nothing, Global.System.Data.MappingType.Element)
569: MyBase.Columns.Add(Me.columnIsAuthenticated)
570: Me.columnIsLocal = New Global.System.Data.DataColumn("IsLocal", GetType(Integer), Nothing, Global.System.Data.MappingType.Element)
571: MyBase.Columns.Add(Me.columnIsLocal)
572: Me.columnUserAgent = New Global.System.Data.DataColumn("UserAgent", GetType(String), Nothing, Global.System.Data.MappingType.Element)
573: MyBase.Columns.Add(Me.columnUserAgent)
574: Me.columnHeaders = New Global.System.Data.DataColumn("Headers", GetType(String), Nothing, Global.System.Data.MappingType.Element)
575: MyBase.Columns.Add(Me.columnHeaders)
576: Me.Constraints.Add(New Global.System.Data.UniqueConstraint("TraceLogKey1", New Global.System.Data.DataColumn() {Me.columni}, true))
577: Me.columni.AutoIncrement = true
578: Me.columni.AutoIncrementSeed = -1
579: Me.columni.AutoIncrementStep = -1
580: Me.columni.AllowDBNull = false
581: Me.columni.ReadOnly = true
582: Me.columni.Unique = true
583: Me.columnCrDate.AllowDBNull = false
584: Me.columnRawUrl.MaxLength = 1000
585: Me.columnUrlReferrer.MaxLength = 1000
586: Me.columnHttpMethod.MaxLength = 50
587: Me.columnUserHostAddress.MaxLength = 50
588: Me.columnQueryString.MaxLength = 4000
589: Me.columnForm.MaxLength = 4000
590: Me.columnRequestParams.MaxLength = 4000
591: Me.columnUserAgent.MaxLength = 4000
592: Me.columnHeaders.MaxLength = 4000
593: End Sub
594:
595: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
596: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
597: Public Function NewTraceLogRow() As TraceLogRow
598: Return CType(Me.NewRow,TraceLogRow)
599: End Function
600:
601: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
602: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
603: Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow
604: Return New TraceLogRow(builder)
605: End Function
606:
607: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
608: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
609: Protected Overrides Function GetRowType() As Global.System.Type
610: Return GetType(TraceLogRow)
611: End Function
612:
613: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
614: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
615: Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs)
616: MyBase.OnRowChanged(e)
617: If (Not (Me.TraceLogRowChangedEvent) Is Nothing) Then
618: RaiseEvent TraceLogRowChanged(Me, New TraceLogRowChangeEvent(CType(e.Row,TraceLogRow), e.Action))
619: End If
620: End Sub
621:
622: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
623: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
624: Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs)
625: MyBase.OnRowChanging(e)
626: If (Not (Me.TraceLogRowChangingEvent) Is Nothing) Then
627: RaiseEvent TraceLogRowChanging(Me, New TraceLogRowChangeEvent(CType(e.Row,TraceLogRow), e.Action))
628: End If
629: End Sub
630:
631: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
632: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
633: Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs)
634: MyBase.OnRowDeleted(e)
635: If (Not (Me.TraceLogRowDeletedEvent) Is Nothing) Then
636: RaiseEvent TraceLogRowDeleted(Me, New TraceLogRowChangeEvent(CType(e.Row,TraceLogRow), e.Action))
637: End If
638: End Sub
639:
640: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
641: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
642: Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs)
643: MyBase.OnRowDeleting(e)
644: If (Not (Me.TraceLogRowDeletingEvent) Is Nothing) Then
645: RaiseEvent TraceLogRowDeleting(Me, New TraceLogRowChangeEvent(CType(e.Row,TraceLogRow), e.Action))
646: End If
647: End Sub
648:
649: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
650: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
651: Public Sub RemoveTraceLogRow(ByVal row As TraceLogRow)
652: Me.Rows.Remove(row)
653: End Sub
654:
655: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
656: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
657: Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType
658: Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType()
659: Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence()
660: Dim ds As TraceLog_DS = New TraceLog_DS()
661: Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
662: any1.Namespace = "http://www.w3.org/2001/XMLSchema"
663: any1.MinOccurs = New Decimal(0)
664: any1.MaxOccurs = Decimal.MaxValue
665: any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax
666: sequence.Items.Add(any1)
667: Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
668: any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"
669: any2.MinOccurs = New Decimal(1)
670: any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax
671: sequence.Items.Add(any2)
672: Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute()
673: attribute1.Name = "namespace"
674: attribute1.FixedValue = ds.Namespace
675: type.Attributes.Add(attribute1)
676: Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute()
677: attribute2.Name = "tableTypeName"
678: attribute2.FixedValue = "TraceLogDataTable"
679: type.Attributes.Add(attribute2)
680: type.Particle = sequence
681: Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable
682: If xs.Contains(dsSchema.TargetNamespace) Then
683: Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
684: Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
685: Try
686: Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing
687: dsSchema.Write(s1)
688: Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator
689: Do While schemas.MoveNext
690: schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema)
691: s2.SetLength(0)
692: schema.Write(s2)
693: If (s1.Length = s2.Length) Then
694: s1.Position = 0
695: s2.Position = 0
696:
697: Do While ((s1.Position <> s1.Length) _
698: AndAlso (s1.ReadByte = s2.ReadByte))
699:
700:
701: Loop
702: If (s1.Position = s1.Length) Then
703: Return type
704: End If
705: End If
706:
707: Loop
708: Finally
709: If (Not (s1) Is Nothing) Then
710: s1.Close
711: End If
712: If (Not (s2) Is Nothing) Then
713: s2.Close
714: End If
715: End Try
716: End If
717: xs.Add(dsSchema)
718: Return type
719: End Function
720: End Class
721:
722: '''<summary>
723: '''Represents strongly named DataRow class.
724: '''</summary>
725: Partial Public Class TraceLogRow
726: Inherits Global.System.Data.DataRow
727:
728: Private tableTraceLog As TraceLogDataTable
729:
730: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
731: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
732: Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder)
733: MyBase.New(rb)
734: Me.tableTraceLog = CType(Me.Table,TraceLogDataTable)
735: End Sub
736:
737: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
738: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
739: Public Property i() As Integer
740: Get
741: Return CType(Me(Me.tableTraceLog.iColumn),Integer)
742: End Get
743: Set
744: Me(Me.tableTraceLog.iColumn) = value
745: End Set
746: End Property
747:
748: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
749: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
750: Public Property CrDate() As Date
751: Get
752: Return CType(Me(Me.tableTraceLog.CrDateColumn),Date)
753: End Get
754: Set
755: Me(Me.tableTraceLog.CrDateColumn) = value
756: End Set
757: End Property
758:
759: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
760: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
761: Public Property RawUrl() As String
762: Get
763: Try
764: Return CType(Me(Me.tableTraceLog.RawUrlColumn),String)
765: Catch e As Global.System.InvalidCastException
766: Throw New Global.System.Data.StrongTypingException("The value for column 'RawUrl' in table 'TraceLog' is DBNull.", e)
767: End Try
768: End Get
769: Set
770: Me(Me.tableTraceLog.RawUrlColumn) = value
771: End Set
772: End Property
773:
774: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
775: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
776: Public Property UrlReferrer() As String
777: Get
778: Try
779: Return CType(Me(Me.tableTraceLog.UrlReferrerColumn),String)
780: Catch e As Global.System.InvalidCastException
781: Throw New Global.System.Data.StrongTypingException("The value for column 'UrlReferrer' in table 'TraceLog' is DBNull.", e)
782: End Try
783: End Get
784: Set
785: Me(Me.tableTraceLog.UrlReferrerColumn) = value
786: End Set
787: End Property
788:
789: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
790: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
791: Public Property HttpMethod() As String
792: Get
793: Try
794: Return CType(Me(Me.tableTraceLog.HttpMethodColumn),String)
795: Catch e As Global.System.InvalidCastException
796: Throw New Global.System.Data.StrongTypingException("The value for column 'HttpMethod' in table 'TraceLog' is DBNull.", e)
797: End Try
798: End Get
799: Set
800: Me(Me.tableTraceLog.HttpMethodColumn) = value
801: End Set
802: End Property
803:
804: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
805: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
806: Public Property UserHostAddress() As String
807: Get
808: Try
809: Return CType(Me(Me.tableTraceLog.UserHostAddressColumn),String)
810: Catch e As Global.System.InvalidCastException
811: Throw New Global.System.Data.StrongTypingException("The value for column 'UserHostAddress' in table 'TraceLog' is DBNull.", e)
812: End Try
813: End Get
814: Set
815: Me(Me.tableTraceLog.UserHostAddressColumn) = value
816: End Set
817: End Property
818:
819: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
820: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
821: Public Property QueryString() As String
822: Get
823: Try
824: Return CType(Me(Me.tableTraceLog.QueryStringColumn),String)
825: Catch e As Global.System.InvalidCastException
826: Throw New Global.System.Data.StrongTypingException("The value for column 'QueryString' in table 'TraceLog' is DBNull.", e)
827: End Try
828: End Get
829: Set
830: Me(Me.tableTraceLog.QueryStringColumn) = value
831: End Set
832: End Property
833:
834: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
835: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
836: Public Property Form() As String
837: Get
838: If Me.IsFormNull Then
839: Return String.Empty
840: Else
841: Return CType(Me(Me.tableTraceLog.FormColumn),String)
842: End If
843: End Get
844: Set
845: Me(Me.tableTraceLog.FormColumn) = value
846: End Set
847: End Property
848:
849: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
850: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
851: Public Property RequestParams() As String
852: Get
853: Try
854: Return CType(Me(Me.tableTraceLog.RequestParamsColumn),String)
855: Catch e As Global.System.InvalidCastException
856: Throw New Global.System.Data.StrongTypingException("The value for column 'RequestParams' in table 'TraceLog' is DBNull.", e)
857: End Try
858: End Get
859: Set
860: Me(Me.tableTraceLog.RequestParamsColumn) = value
861: End Set
862: End Property
863:
864: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
865: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
866: Public Property InputStreamLength() As Integer
867: Get
868: Try
869: Return CType(Me(Me.tableTraceLog.InputStreamLengthColumn),Integer)
870: Catch e As Global.System.InvalidCastException
871: Throw New Global.System.Data.StrongTypingException("The value for column 'InputStreamLength' in table 'TraceLog' is DBNull.", e)
872: End Try
873: End Get
874: Set
875: Me(Me.tableTraceLog.InputStreamLengthColumn) = value
876: End Set
877: End Property
878:
879: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
880: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
881: Public Property IsAuthenticated() As Integer
882: Get
883: Try
884: Return CType(Me(Me.tableTraceLog.IsAuthenticatedColumn),Integer)
885: Catch e As Global.System.InvalidCastException
886: Throw New Global.System.Data.StrongTypingException("The value for column 'IsAuthenticated' in table 'TraceLog' is DBNull.", e)
887: End Try
888: End Get
889: Set
890: Me(Me.tableTraceLog.IsAuthenticatedColumn) = value
891: End Set
892: End Property
893:
894: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
895: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
896: Public Property IsLocal() As Integer
897: Get
898: Try
899: Return CType(Me(Me.tableTraceLog.IsLocalColumn),Integer)
900: Catch e As Global.System.InvalidCastException
901: Throw New Global.System.Data.StrongTypingException("The value for column 'IsLocal' in table 'TraceLog' is DBNull.", e)
902: End Try
903: End Get
904: Set
905: Me(Me.tableTraceLog.IsLocalColumn) = value
906: End Set
907: End Property
908:
909: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
910: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
911: Public Property UserAgent() As String
912: Get
913: Try
914: Return CType(Me(Me.tableTraceLog.UserAgentColumn),String)
915: Catch e As Global.System.InvalidCastException
916: Throw New Global.System.Data.StrongTypingException("The value for column 'UserAgent' in table 'TraceLog' is DBNull.", e)
917: End Try
918: End Get
919: Set
920: Me(Me.tableTraceLog.UserAgentColumn) = value
921: End Set
922: End Property
923:
924: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
925: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
926: Public Property Headers() As String
927: Get
928: Try
929: Return CType(Me(Me.tableTraceLog.HeadersColumn),String)
930: Catch e As Global.System.InvalidCastException
931: Throw New Global.System.Data.StrongTypingException("The value for column 'Headers' in table 'TraceLog' is DBNull.", e)
932: End Try
933: End Get
934: Set
935: Me(Me.tableTraceLog.HeadersColumn) = value
936: End Set
937: End Property
938:
939: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
940: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
941: Public Function IsRawUrlNull() As Boolean
942: Return Me.IsNull(Me.tableTraceLog.RawUrlColumn)
943: End Function
944:
945: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
946: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
947: Public Sub SetRawUrlNull()
948: Me(Me.tableTraceLog.RawUrlColumn) = Global.System.Convert.DBNull
949: End Sub
950:
951: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
952: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
953: Public Function IsUrlReferrerNull() As Boolean
954: Return Me.IsNull(Me.tableTraceLog.UrlReferrerColumn)
955: End Function
956:
957: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
958: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
959: Public Sub SetUrlReferrerNull()
960: Me(Me.tableTraceLog.UrlReferrerColumn) = Global.System.Convert.DBNull
961: End Sub
962:
963: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
964: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
965: Public Function IsHttpMethodNull() As Boolean
966: Return Me.IsNull(Me.tableTraceLog.HttpMethodColumn)
967: End Function
968:
969: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
970: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
971: Public Sub SetHttpMethodNull()
972: Me(Me.tableTraceLog.HttpMethodColumn) = Global.System.Convert.DBNull
973: End Sub
974:
975: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
976: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
977: Public Function IsUserHostAddressNull() As Boolean
978: Return Me.IsNull(Me.tableTraceLog.UserHostAddressColumn)
979: End Function
980:
981: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
982: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
983: Public Sub SetUserHostAddressNull()
984: Me(Me.tableTraceLog.UserHostAddressColumn) = Global.System.Convert.DBNull
985: End Sub
986:
987: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
988: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
989: Public Function IsQueryStringNull() As Boolean
990: Return Me.IsNull(Me.tableTraceLog.QueryStringColumn)
991: End Function
992:
993: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
994: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
995: Public Sub SetQueryStringNull()
996: Me(Me.tableTraceLog.QueryStringColumn) = Global.System.Convert.DBNull
997: End Sub
998:
999: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1000: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1001: Public Function IsFormNull() As Boolean
1002: Return Me.IsNull(Me.tableTraceLog.FormColumn)
1003: End Function
1004:
1005: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1006: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1007: Public Sub SetFormNull()
1008: Me(Me.tableTraceLog.FormColumn) = Global.System.Convert.DBNull
1009: End Sub
1010:
1011: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1012: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1013: Public Function IsRequestParamsNull() As Boolean
1014: Return Me.IsNull(Me.tableTraceLog.RequestParamsColumn)
1015: End Function
1016:
1017: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1018: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1019: Public Sub SetRequestParamsNull()
1020: Me(Me.tableTraceLog.RequestParamsColumn) = Global.System.Convert.DBNull
1021: End Sub
1022:
1023: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1024: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1025: Public Function IsInputStreamLengthNull() As Boolean
1026: Return Me.IsNull(Me.tableTraceLog.InputStreamLengthColumn)
1027: End Function
1028:
1029: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1030: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1031: Public Sub SetInputStreamLengthNull()
1032: Me(Me.tableTraceLog.InputStreamLengthColumn) = Global.System.Convert.DBNull
1033: End Sub
1034:
1035: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1036: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1037: Public Function IsIsAuthenticatedNull() As Boolean
1038: Return Me.IsNull(Me.tableTraceLog.IsAuthenticatedColumn)
1039: End Function
1040:
1041: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1042: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1043: Public Sub SetIsAuthenticatedNull()
1044: Me(Me.tableTraceLog.IsAuthenticatedColumn) = Global.System.Convert.DBNull
1045: End Sub
1046:
1047: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1048: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1049: Public Function IsIsLocalNull() As Boolean
1050: Return Me.IsNull(Me.tableTraceLog.IsLocalColumn)
1051: End Function
1052:
1053: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1054: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1055: Public Sub SetIsLocalNull()
1056: Me(Me.tableTraceLog.IsLocalColumn) = Global.System.Convert.DBNull
1057: End Sub
1058:
1059: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1060: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1061: Public Function IsUserAgentNull() As Boolean
1062: Return Me.IsNull(Me.tableTraceLog.UserAgentColumn)
1063: End Function
1064:
1065: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1066: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1067: Public Sub SetUserAgentNull()
1068: Me(Me.tableTraceLog.UserAgentColumn) = Global.System.Convert.DBNull
1069: End Sub
1070:
1071: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1072: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1073: Public Function IsHeadersNull() As Boolean
1074: Return Me.IsNull(Me.tableTraceLog.HeadersColumn)
1075: End Function
1076:
1077: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1078: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1079: Public Sub SetHeadersNull()
1080: Me(Me.tableTraceLog.HeadersColumn) = Global.System.Convert.DBNull
1081: End Sub
1082: End Class
1083:
1084: '''<summary>
1085: '''Row event argument class
1086: '''</summary>
1087: <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1088: Public Class TraceLogRowChangeEvent
1089: Inherits Global.System.EventArgs
1090:
1091: Private eventRow As TraceLogRow
1092:
1093: Private eventAction As Global.System.Data.DataRowAction
1094:
1095: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1096: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1097: Public Sub New(ByVal row As TraceLogRow, ByVal action As Global.System.Data.DataRowAction)
1098: MyBase.New
1099: Me.eventRow = row
1100: Me.eventAction = action
1101: End Sub
1102:
1103: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1104: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1105: Public ReadOnly Property Row() As TraceLogRow
1106: Get
1107: Return Me.eventRow
1108: End Get
1109: End Property
1110:
1111: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1112: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1113: Public ReadOnly Property Action() As Global.System.Data.DataRowAction
1114: Get
1115: Return Me.eventAction
1116: End Get
1117: End Property
1118: End Class
1119: End Class
1120:
1121: Namespace TraceLog_DSTableAdapters
1122:
1123: '''<summary>
1124: '''Represents the connection and commands used to retrieve and save data.
1125: '''</summary>
1126: <Global.System.ComponentModel.DesignerCategoryAttribute("code"), _
1127: Global.System.ComponentModel.ToolboxItem(true), _
1128: Global.System.ComponentModel.DataObjectAttribute(true), _
1129: Global.System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner"& _
1130: ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), _
1131: Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
1132: Partial Public Class TraceLogTableAdapter
1133: Inherits TableAdapterBase
1134:
1135: Private WithEvents _adapter As Global.System.Data.SqlClient.SqlDataAdapter
1136:
1137: Private _connection As Global.System.Data.SqlClient.SqlConnection
1138:
1139: Private _transaction As Global.System.Data.SqlClient.SqlTransaction
1140:
1141: Private _commandCollection() As Global.System.Data.SqlClient.SqlCommand
1142:
1143: Private _clearBeforeFill As Boolean
1144:
1145: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1146: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1147: Public Sub New()
1148: MyBase.New
1149: Me.ClearBeforeFill = true
1150: End Sub
1151:
1152: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1153: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1154: Protected Friend ReadOnly Property Adapter() As Global.System.Data.SqlClient.SqlDataAdapter
1155: Get
1156: If (Me._adapter Is Nothing) Then
1157: Me.InitAdapter
1158: End If
1159: Return Me._adapter
1160: End Get
1161: End Property
1162:
1163: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1164: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1165: Friend Property Connection() As Global.System.Data.SqlClient.SqlConnection
1166: Get
1167: If (Me._connection Is Nothing) Then
1168: Me.InitConnection
1169: End If
1170: Return Me._connection
1171: End Get
1172: Set
1173: Me._connection = value
1174: If (Not (Me.Adapter.InsertCommand) Is Nothing) Then
1175: Me.Adapter.InsertCommand.Connection = value
1176: End If
1177: If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then
1178: Me.Adapter.DeleteCommand.Connection = value
1179: End If
1180: If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then
1181: Me.Adapter.UpdateCommand.Connection = value
1182: End If
1183: Dim i As Integer = 0
1184: Do While (i < Me.CommandCollection.Length)
1185: If (Not (Me.CommandCollection(i)) Is Nothing) Then
1186: CType(Me.CommandCollection(i),Global.System.Data.SqlClient.SqlCommand).Connection = value
1187: End If
1188: i = (i + 1)
1189: Loop
1190: End Set
1191: End Property
1192:
1193: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1194: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1195: Friend Property Transaction() As Global.System.Data.SqlClient.SqlTransaction
1196: Get
1197: Return Me._transaction
1198: End Get
1199: Set
1200: Me._transaction = value
1201: Dim i As Integer = 0
1202: Do While (i < Me.CommandCollection.Length)
1203: Me.CommandCollection(i).Transaction = Me._transaction
1204: i = (i + 1)
1205: Loop
1206: If ((Not (Me.Adapter) Is Nothing) _
1207: AndAlso (Not (Me.Adapter.DeleteCommand) Is Nothing)) Then
1208: Me.Adapter.DeleteCommand.Transaction = Me._transaction
1209: End If
1210: If ((Not (Me.Adapter) Is Nothing) _
1211: AndAlso (Not (Me.Adapter.InsertCommand) Is Nothing)) Then
1212: Me.Adapter.InsertCommand.Transaction = Me._transaction
1213: End If
1214: If ((Not (Me.Adapter) Is Nothing) _
1215: AndAlso (Not (Me.Adapter.UpdateCommand) Is Nothing)) Then
1216: Me.Adapter.UpdateCommand.Transaction = Me._transaction
1217: End If
1218: End Set
1219: End Property
1220:
1221: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1222: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1223: Protected ReadOnly Property CommandCollection() As Global.System.Data.SqlClient.SqlCommand()
1224: Get
1225: If (Me._commandCollection Is Nothing) Then
1226: Me.InitCommandCollection
1227: End If
1228: Return Me._commandCollection
1229: End Get
1230: End Property
1231:
1232: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1233: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1234: Public Property ClearBeforeFill() As Boolean
1235: Get
1236: Return Me._clearBeforeFill
1237: End Get
1238: Set
1239: Me._clearBeforeFill = value
1240: End Set
1241: End Property
1242:
1243: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1244: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1245: Private Sub InitAdapter()
1246: Me._adapter = New Global.System.Data.SqlClient.SqlDataAdapter()
1247: Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping()
1248: tableMapping.SourceTable = "Table"
1249: tableMapping.DataSetTable = "TraceLog"
1250: tableMapping.ColumnMappings.Add("i", "i")
1251: tableMapping.ColumnMappings.Add("CrDate", "CrDate")
1252: tableMapping.ColumnMappings.Add("RawUrl", "RawUrl")
1253: tableMapping.ColumnMappings.Add("UrlReferrer", "UrlReferrer")
1254: tableMapping.ColumnMappings.Add("HttpMethod", "HttpMethod")
1255: tableMapping.ColumnMappings.Add("UserHostAddress", "UserHostAddress")
1256: tableMapping.ColumnMappings.Add("QueryString", "QueryString")
1257: tableMapping.ColumnMappings.Add("Form", "Form")
1258: tableMapping.ColumnMappings.Add("RequestParams", "RequestParams")
1259: tableMapping.ColumnMappings.Add("InputStreamLength", "InputStreamLength")
1260: tableMapping.ColumnMappings.Add("IsAuthenticated", "IsAuthenticated")
1261: tableMapping.ColumnMappings.Add("IsLocal", "IsLocal")
1262: tableMapping.ColumnMappings.Add("UserAgent", "UserAgent")
1263: tableMapping.ColumnMappings.Add("Headers", "Headers")
1264: Me._adapter.TableMappings.Add(tableMapping)
1265: End Sub
1266:
1267: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1268: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1269: Private Sub InitConnection()
1270: Me._connection = New Global.System.Data.SqlClient.SqlConnection()
1271: Me._connection.ConnectionString = Global.Virus.My.MySettings.Default.vOtpusk_ArendaConnectionString
1272: End Sub
1273:
1274: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1275: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1276: Private Sub InitCommandCollection()
1277: Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(2) {}
1278: Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand()
1279: Me._commandCollection(0).Connection = Me.Connection
1280: Me._commandCollection(0).CommandText = "SELECT top(10) i, CrDate, RawUrl, UrlReferrer, HttpMethod, UserHostAddress, Quer"& _
1281: "yString, Form, RequestParams, InputStreamLength, IsAuthenticated, IsLocal, UserA"& _
1282: "gent, Headers FROM dbo.TraceLog"
1283: Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text
1284: Me._commandCollection(1) = New Global.System.Data.SqlClient.SqlCommand()
1285: Me._commandCollection(1).Connection = Me.Connection
1286: Me._commandCollection(1).CommandText = " with All1 as"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" ("&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" SELECT *"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" FROM [vOtpusk_Arenda].[dbo].[TraceLog]"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" wher"& _
1287: "e CrDate > '2015-07-08 08:34:00.810' and CrDate < '2015-07-08 08:35:16.810'"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" a"& _
1288: "nd HttpMethod='POST'"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" union all"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" SELECT * "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" FROM [vOtpusk_Arenda].[d"& _
1289: "bo].[TraceLog]"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" where CrDate > '2015-07-08 08:35:16.810'"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" and HttpMethod='P"& _
1290: "OST'"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" )"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" select * from All1 order by i "
1291: Me._commandCollection(1).CommandType = Global.System.Data.CommandType.Text
1292: Me._commandCollection(2) = New Global.System.Data.SqlClient.SqlCommand()
1293: Me._commandCollection(2).Connection = Me.Connection
1294: Me._commandCollection(2).CommandText = " SELECT *"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" FROM [vOtpusk_Arenda].[dbo].[TraceLog]"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" where CrDate > '2015-07-0"& _
1295: "8 08:34:00.810' and CrDate < '2015-07-08 08:35:16.810'"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" and HttpMethod='POST'"
1296: Me._commandCollection(2).CommandType = Global.System.Data.CommandType.Text
1297: End Sub
1298:
1299: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1300: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
1301: Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
1302: Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)> _
1303: Public Overloads Overridable Function Fill_top10(ByVal dataTable As TraceLog_DS.TraceLogDataTable) As Integer
1304: Me.Adapter.SelectCommand = Me.CommandCollection(0)
1305: If (Me.ClearBeforeFill = true) Then
1306: dataTable.Clear
1307: End If
1308: Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
1309: Return returnValue
1310: End Function
1311:
1312: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1313: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
1314: Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
1315: Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.[Select], true)> _
1316: Public Overloads Overridable Function GetData() As TraceLog_DS.TraceLogDataTable
1317: Me.Adapter.SelectCommand = Me.CommandCollection(0)
1318: Dim dataTable As TraceLog_DS.TraceLogDataTable = New TraceLog_DS.TraceLogDataTable()
1319: Me.Adapter.Fill(dataTable)
1320: Return dataTable
1321: End Function
1322:
1323: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1324: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
1325: Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
1326: Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, false)> _
1327: Public Overloads Overridable Function FillByAllPost(ByVal dataTable As TraceLog_DS.TraceLogDataTable) As Integer
1328: Me.Adapter.SelectCommand = Me.CommandCollection(1)
1329: If (Me.ClearBeforeFill = true) Then
1330: dataTable.Clear
1331: End If
1332: Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
1333: Return returnValue
1334: End Function
1335:
1336: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1337: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
1338: Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
1339: Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.[Select], false)> _
1340: Public Overloads Overridable Function GetDataByAllPost() As TraceLog_DS.TraceLogDataTable
1341: Me.Adapter.SelectCommand = Me.CommandCollection(1)
1342: Dim dataTable As TraceLog_DS.TraceLogDataTable = New TraceLog_DS.TraceLogDataTable()
1343: Me.Adapter.Fill(dataTable)
1344: Return dataTable
1345: End Function
1346:
1347: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1348: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
1349: Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
1350: Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, false)> _
1351: Public Overloads Overridable Function FillByVirus(ByVal dataTable As TraceLog_DS.TraceLogDataTable) As Integer
1352: Me.Adapter.SelectCommand = Me.CommandCollection(2)
1353: If (Me.ClearBeforeFill = true) Then
1354: dataTable.Clear
1355: End If
1356: Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
1357: Return returnValue
1358: End Function
1359:
1360: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1361: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
1362: Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
1363: Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.[Select], false)> _
1364: Public Overloads Overridable Function GetDataByVirus() As TraceLog_DS.TraceLogDataTable
1365: Me.Adapter.SelectCommand = Me.CommandCollection(2)
1366: Dim dataTable As TraceLog_DS.TraceLogDataTable = New TraceLog_DS.TraceLogDataTable()
1367: Me.Adapter.Fill(dataTable)
1368: Return dataTable
1369: End Function
1370: End Class
1371:
1372: '''<summary>
1373: '''TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
1374: '''</summary>
1375: <Global.System.ComponentModel.DesignerCategoryAttribute("code"), _
1376: Global.System.ComponentModel.ToolboxItem(true), _
1377: Global.System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD"& _
1378: "esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), _
1379: Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")> _
1380: Partial Public Class TableAdapterManager
1381: Inherits Global.System.ComponentModel.Component
1382:
1383: Private _updateOrder As UpdateOrderOption
1384:
1385: Private _backupDataSetBeforeUpdate As Boolean
1386:
1387: Private _connection As Global.System.Data.IDbConnection
1388:
1389: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1390: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1391: Public Property UpdateOrder() As UpdateOrderOption
1392: Get
1393: Return Me._updateOrder
1394: End Get
1395: Set
1396: Me._updateOrder = value
1397: End Set
1398: End Property
1399:
1400: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1401: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1402: Public Property BackupDataSetBeforeUpdate() As Boolean
1403: Get
1404: Return Me._backupDataSetBeforeUpdate
1405: End Get
1406: Set
1407: Me._backupDataSetBeforeUpdate = value
1408: End Set
1409: End Property
1410:
1411: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1412: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
1413: Global.System.ComponentModel.Browsable(false)> _
1414: Public Property Connection() As Global.System.Data.IDbConnection
1415: Get
1416: If (Not (Me._connection) Is Nothing) Then
1417: Return Me._connection
1418: End If
1419: Return Nothing
1420: End Get
1421: Set
1422: Me._connection = value
1423: End Set
1424: End Property
1425:
1426: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1427: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
1428: Global.System.ComponentModel.Browsable(false)> _
1429: Public ReadOnly Property TableAdapterInstanceCount() As Integer
1430: Get
1431: Dim count As Integer = 0
1432: Return count
1433: End Get
1434: End Property
1435:
1436: '''<summary>
1437: '''Update rows in top-down order.
1438: '''</summary>
1439: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1440: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1441: Private Function UpdateUpdatedRows(ByVal dataSet As TraceLog_DS, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow), ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer
1442: Dim result As Integer = 0
1443: Return result
1444: End Function
1445:
1446: '''<summary>
1447: '''Insert rows in top-down order.
1448: '''</summary>
1449: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1450: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1451: Private Function UpdateInsertedRows(ByVal dataSet As TraceLog_DS, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer
1452: Dim result As Integer = 0
1453: Return result
1454: End Function
1455:
1456: '''<summary>
1457: '''Delete rows in bottom-up order.
1458: '''</summary>
1459: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1460: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1461: Private Function UpdateDeletedRows(ByVal dataSet As TraceLog_DS, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer
1462: Dim result As Integer = 0
1463: Return result
1464: End Function
1465:
1466: '''<summary>
1467: '''Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
1468: '''</summary>
1469: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1470: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1471: Private Function GetRealUpdatedRows(ByVal updatedRows() As Global.System.Data.DataRow, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Global.System.Data.DataRow()
1472: If ((updatedRows Is Nothing) _
1473: OrElse (updatedRows.Length < 1)) Then
1474: Return updatedRows
1475: End If
1476: If ((allAddedRows Is Nothing) _
1477: OrElse (allAddedRows.Count < 1)) Then
1478: Return updatedRows
1479: End If
1480: Dim realUpdatedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)()
1481: Dim i As Integer = 0
1482: Do While (i < updatedRows.Length)
1483: Dim row As Global.System.Data.DataRow = updatedRows(i)
1484: If (allAddedRows.Contains(row) = false) Then
1485: realUpdatedRows.Add(row)
1486: End If
1487: i = (i + 1)
1488: Loop
1489: Return realUpdatedRows.ToArray
1490: End Function
1491:
1492: '''<summary>
1493: '''Update all changes to the dataset.
1494: '''</summary>
1495: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1496: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1497: Public Overridable Function UpdateAll(ByVal dataSet As TraceLog_DS) As Integer
1498: If (dataSet Is Nothing) Then
1499: Throw New Global.System.ArgumentNullException("dataSet")
1500: End If
1501: If (dataSet.HasChanges = false) Then
1502: Return 0
1503: End If
1504: Dim workConnection As Global.System.Data.IDbConnection = Me.Connection
1505: If (workConnection Is Nothing) Then
1506: Throw New Global.System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana"& _
1507: "ger TableAdapter property to a valid TableAdapter instance.")
1508: End If
1509: Dim workConnOpened As Boolean = false
1510: If ((workConnection.State And Global.System.Data.ConnectionState.Broken) _
1511: = Global.System.Data.ConnectionState.Broken) Then
1512: workConnection.Close
1513: End If
1514: If (workConnection.State = Global.System.Data.ConnectionState.Closed) Then
1515: workConnection.Open
1516: workConnOpened = true
1517: End If
1518: Dim workTransaction As Global.System.Data.IDbTransaction = workConnection.BeginTransaction
1519: If (workTransaction Is Nothing) Then
1520: Throw New Global.System.ApplicationException("The transaction cannot begin. The current data connection does not support transa"& _
1521: "ctions or the current state is not allowing the transaction to begin.")
1522: End If
1523: Dim allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)()
1524: Dim allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)()
1525: Dim adaptersWithAcceptChangesDuringUpdate As Global.System.Collections.Generic.List(Of Global.System.Data.Common.DataAdapter) = New Global.System.Collections.Generic.List(Of Global.System.Data.Common.DataAdapter)()
1526: Dim revertConnections As Global.System.Collections.Generic.Dictionary(Of Object, Global.System.Data.IDbConnection) = New Global.System.Collections.Generic.Dictionary(Of Object, Global.System.Data.IDbConnection)()
1527: Dim result As Integer = 0
1528: Dim backupDataSet As Global.System.Data.DataSet = Nothing
1529: If Me.BackupDataSetBeforeUpdate Then
1530: backupDataSet = New Global.System.Data.DataSet()
1531: backupDataSet.Merge(dataSet)
1532: End If
1533: Try
1534: '---- Prepare for update -----------
1535: '
1536: '
1537: '---- Perform updates -----------
1538: '
1539: If (Me.UpdateOrder = UpdateOrderOption.UpdateInsertDelete) Then
1540: result = (result + Me.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows))
1541: result = (result + Me.UpdateInsertedRows(dataSet, allAddedRows))
1542: Else
1543: result = (result + Me.UpdateInsertedRows(dataSet, allAddedRows))
1544: result = (result + Me.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows))
1545: End If
1546: result = (result + Me.UpdateDeletedRows(dataSet, allChangedRows))
1547: '
1548: '---- Commit updates -----------
1549: '
1550: workTransaction.Commit
1551: If (0 < allAddedRows.Count) Then
1552: Dim rows((allAddedRows.Count) - 1) As Global.System.Data.DataRow
1553: allAddedRows.CopyTo(rows)
1554: Dim i As Integer = 0
1555: Do While (i < rows.Length)
1556: Dim row As Global.System.Data.DataRow = rows(i)
1557: row.AcceptChanges
1558: i = (i + 1)
1559: Loop
1560: End If
1561: If (0 < allChangedRows.Count) Then
1562: Dim rows((allChangedRows.Count) - 1) As Global.System.Data.DataRow
1563: allChangedRows.CopyTo(rows)
1564: Dim i As Integer = 0
1565: Do While (i < rows.Length)
1566: Dim row As Global.System.Data.DataRow = rows(i)
1567: row.AcceptChanges
1568: i = (i + 1)
1569: Loop
1570: End If
1571: Catch ex As Global.System.Exception
1572: workTransaction.Rollback
1573: '---- Restore the dataset -----------
1574: If Me.BackupDataSetBeforeUpdate Then
1575: Global.System.Diagnostics.Debug.Assert((Not (backupDataSet) Is Nothing))
1576: dataSet.Clear
1577: dataSet.Merge(backupDataSet)
1578: Else
1579: If (0 < allAddedRows.Count) Then
1580: Dim rows((allAddedRows.Count) - 1) As Global.System.Data.DataRow
1581: allAddedRows.CopyTo(rows)
1582: Dim i As Integer = 0
1583: Do While (i < rows.Length)
1584: Dim row As Global.System.Data.DataRow = rows(i)
1585: row.AcceptChanges
1586: row.SetAdded
1587: i = (i + 1)
1588: Loop
1589: End If
1590: End If
1591: Throw ex
1592: Finally
1593: If workConnOpened Then
1594: workConnection.Close
1595: End If
1596: If (0 < adaptersWithAcceptChangesDuringUpdate.Count) Then
1597: Dim adapters((adaptersWithAcceptChangesDuringUpdate.Count) - 1) As Global.System.Data.Common.DataAdapter
1598: adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters)
1599: Dim i As Integer = 0
1600: Do While (i < adapters.Length)
1601: Dim adapter As Global.System.Data.Common.DataAdapter = adapters(i)
1602: adapter.AcceptChangesDuringUpdate = true
1603: i = (i + 1)
1604: Loop
1605: End If
1606: End Try
1607: Return result
1608: End Function
1609:
1610: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1611: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1612: Protected Overridable Sub SortSelfReferenceRows(ByVal rows() As Global.System.Data.DataRow, ByVal relation As Global.System.Data.DataRelation, ByVal childFirst As Boolean)
1613: Global.System.Array.Sort(Of Global.System.Data.DataRow)(rows, New SelfReferenceComparer(relation, childFirst))
1614: End Sub
1615:
1616: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1617: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1618: Protected Overridable Function MatchTableAdapterConnection(ByVal inputConnection As Global.System.Data.IDbConnection) As Boolean
1619: If (Not (Me._connection) Is Nothing) Then
1620: Return true
1621: End If
1622: If ((Me.Connection Is Nothing) _
1623: OrElse (inputConnection Is Nothing)) Then
1624: Return true
1625: End If
1626: If String.Equals(Me.Connection.ConnectionString, inputConnection.ConnectionString, Global.System.StringComparison.Ordinal) Then
1627: Return true
1628: End If
1629: Return false
1630: End Function
1631:
1632: '''<summary>
1633: '''Update Order Option
1634: '''</summary>
1635: <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1636: Public Enum UpdateOrderOption
1637:
1638: InsertUpdateDelete = 0
1639:
1640: UpdateInsertDelete = 1
1641: End Enum
1642:
1643: '''<summary>
1644: '''Used to sort self-referenced table's rows
1645: '''</summary>
1646: <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1647: Private Class SelfReferenceComparer
1648: Inherits Object
1649: Implements Global.System.Collections.Generic.IComparer(Of Global.System.Data.DataRow)
1650:
1651: Private _relation As Global.System.Data.DataRelation
1652:
1653: Private _childFirst As Integer
1654:
1655: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1656: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1657: Friend Sub New(ByVal relation As Global.System.Data.DataRelation, ByVal childFirst As Boolean)
1658: MyBase.New
1659: Me._relation = relation
1660: If childFirst Then
1661: Me._childFirst = -1
1662: Else
1663: Me._childFirst = 1
1664: End If
1665: End Sub
1666:
1667: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1668: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1669: Private Function GetRoot(ByVal row As Global.System.Data.DataRow, ByRef distance As Integer) As Global.System.Data.DataRow
1670: Global.System.Diagnostics.Debug.Assert((Not (row) Is Nothing))
1671: Dim root As Global.System.Data.DataRow = row
1672: distance = 0
1673:
1674: Dim traversedRows As Global.System.Collections.Generic.IDictionary(Of Global.System.Data.DataRow, Global.System.Data.DataRow) = New Global.System.Collections.Generic.Dictionary(Of Global.System.Data.DataRow, Global.System.Data.DataRow)()
1675: traversedRows(row) = row
1676:
1677: Dim parent As Global.System.Data.DataRow = row.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.[Default])
1678:
1679: Do While ((Not (parent) Is Nothing) _
1680: AndAlso (traversedRows.ContainsKey(parent) = false))
1681: distance = (distance + 1)
1682: root = parent
1683: traversedRows(parent) = parent
1684: parent = parent.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.[Default])
1685:
1686: Loop
1687:
1688: If (distance = 0) Then
1689: traversedRows.Clear
1690: traversedRows(row) = row
1691: parent = row.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.Original)
1692:
1693: Do While ((Not (parent) Is Nothing) _
1694: AndAlso (traversedRows.ContainsKey(parent) = false))
1695: distance = (distance + 1)
1696: root = parent
1697: traversedRows(parent) = parent
1698: parent = parent.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.Original)
1699:
1700: Loop
1701: End If
1702:
1703: Return root
1704: End Function
1705:
1706: <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
1707: Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
1708: Public Function Compare(ByVal row1 As Global.System.Data.DataRow, ByVal row2 As Global.System.Data.DataRow) As Integer Implements Global.System.Collections.Generic.IComparer(Of Global.System.Data.DataRow).Compare
1709: If Object.ReferenceEquals(row1, row2) Then
1710: Return 0
1711: End If
1712: If (row1 Is Nothing) Then
1713: Return -1
1714: End If
1715: If (row2 Is Nothing) Then
1716: Return 1
1717: End If
1718:
1719: Dim distance1 As Integer = 0
1720: Dim root1 As Global.System.Data.DataRow = Me.GetRoot(row1, distance1)
1721:
1722: Dim distance2 As Integer = 0
1723: Dim root2 As Global.System.Data.DataRow = Me.GetRoot(row2, distance2)
1724:
1725: If Object.ReferenceEquals(root1, root2) Then
1726: Return (Me._childFirst * distance1.CompareTo(distance2))
1727: Else
1728: Global.System.Diagnostics.Debug.Assert(((Not (root1.Table) Is Nothing) _
1729: AndAlso (Not (root2.Table) Is Nothing)))
1730: If (root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2)) Then
1731: Return -1
1732: Else
1733: Return 1
1734: End If
1735: End If
1736: End Function
1737: End Class
1738: End Class
1739: End Namespace
І ось тут стоп. Тут є один із важливіших моментів цієї проги, без якого прога працювати не буде. Таймаути операцій до SQL встановлені на декілька секунд, а до такої бази, як у цьому проекті запити продовжуються декілька хвилин. Тому подивиться на стрічку 1133 - там е важлива модифікація коду, яка вноситься руками. Замість наслідку цього класу від класу System.ComponentModel.Component я зробив наслідування від свого класу TableAdapterBase, у я кому за допомогою System.Reflection я модифікував стандартні таймаути.
1: Public Class TableAdapterBase
2: Inherits System.ComponentModel.Component
3: Public Sub New()
4: SetCommandTimeout(GetConnection().ConnectionTimeout)
5: End Sub
6:
7: Public Sub SetCommandTimeout(Timeout As Integer)
8: For Each One In SelectCommand()
9: One.CommandTimeout = Timeout
10: Next
11: End Sub
12:
13: Private Function GetConnection() As System.Data.SqlClient.SqlConnection
14: Return TryCast(GetProperty("Connection"), System.Data.SqlClient.SqlConnection)
15: End Function
16:
17: Private Function SelectCommand() As SqlClient.SqlCommand()
18: Return TryCast(GetProperty("CommandCollection"), SqlClient.SqlCommand())
19: End Function
20:
21: Private Function GetProperty(s As [String]) As [Object]
22: Return Me.[GetType]().GetProperty(s, Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.GetProperty Or Reflection.BindingFlags.Instance).GetValue(Me, Nothing)
23: End Function
24: End Class
І на Module1, у якому розташована функція DecodeHTML - стоп іще раз.
1: Module Module1
2: Function DecodeHTML(Str1) As String
3: Dim Ret As New System.Text.StringBuilder
4: Dim I As Integer
5: Do While I < Str1.Length - 1
6: If Str1(I) & Str1(I + 1) = "%u" Then
7: Dim OneChar As String = Mid(Str1, I + 3, 4)
8: I = I + 6
9: Dim HexVal As Integer
10: HexVal = Convert.ToInt32(OneChar, 16)
11: Dim TwoByte(1) As Byte
12: 'меняем байты местами
13: TwoByte(1) = Convert.ToByte(Mid(OneChar, 1, 2), 16)
14: TwoByte(0) = Convert.ToByte(Mid(OneChar, 3, 2), 16)
15: Dim U As New System.Text.UnicodeEncoding
16: Dim Rus As String = U.GetChars(TwoByte)
17: Ret.Append(Rus)
18: ElseIf Str1(I) = "+" Then
19: I = I + 1
20: Ret.Append(" ")
21: ElseIf Str1(I) = "%" Then
22: I = I + 3
23: Ret.Append(Mid(Str1, I + 2, 2))
24: Else
25: I = I + 1
26: Ret.Append(Str1(I))
27: End If
28: Loop
29: Return Ret.ToString
30: End Function
31: End Module
Я не знайшов у мікрософтовській бібліотеці (яка нараховує біля 100 тисяч класів) функціі, яка перекодує ESCAPE HTML ENTITY у прості стрічні константи. І написав цю функцию сам ПРИБЛИЗНО. Але моїм потребам вона відповідає. Якщо вам потрібно повністю коректне перекодування, то потрібно усі двосимвольні escape-послідовності корректно розкодувати. Я над цією функцію роздумував мабуть дві години, пока зрозумів що байти потрібно змініти місцями. Бо прямий порядок байт вікористовується у процессорах IBM, а у процессорах INTEL вікористовується зворотній порядок байтів при комбінування байтів у полу-слова і слова. Після цього усвідомлення - все останне у цієї функції було ділом суто технічним і нецікавим - а оскільки зайвого часу у мене не було (бо ця прога набагато більше ніж тут описано) - перекодування деяких послідовностей залишилося приблизним.
|