ASP.NET at Work: Building 10 Enterprise Projects PHẦN 4 doc

64 278 0
ASP.NET at Work: Building 10 Enterprise Projects PHẦN 4 doc

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

ELSE BEGIN COMMIT TRAN SET @SiteID = @tmpID END Listing 4.1 registerSite stored procedure (continued) The unregisterSite Stored Procedure This procedure is the opposite of the registerSite stored procedure. It is called when the ASP.NET application no longer needs to collect the log files for a given site. The stored procedure is defined in Listing 4.2. CREATE PROCEDURE [dbo].[unregisterSite] ( @SiteID uniqueidentifier ) AS BEGIN TRAN DECLARE @SQLStatement nvarchar(2000) DECLARE @MachineName nvarchar(15) DECLARE @SiteIndex smallint DECLARE @TableName nvarchar(25) First delete the entries from the child table so as not to cause any Foreign key constraint violations. DELETE FROM LogSource WHERE [Site] = @SiteID Then select the machine name and site index from the log site table that corresponds to this registered site so we can build our SQL statement dynamically. SELECT @MachineName = [MachineName], @SiteIndex = [SiteIndex] FROM LogSite WHERE [ID] = @SiteID Remove the site entry. DELETE FROM LogSite WHERE [ID] = @SiteID SET @TableName = @MachineName + N’W3SVC’ + CONVERT(nvarchar(5), @SiteIndex) And finally, drop the entries table for this site. IF EXISTS(SELECT * FROM dbo.sysobjects WHERE [ID] = OBJECT_ID(@TableName) AND OBJECTPROPERTY([ID], N’IsUserTable’) = 1) BEGIN SET @SQLStatement = N’DROP TABLE ‘ + @TableName EXECUTE sp_executesql @SQLStatement Listing 4.2 unregisterSite stored procedure Building the Web Log Analyzer 175 SET @SQLStatement = N’DROP VIEW vw_’ + @TableName EXECUTE sp_executesql @SQLStatement END EXIT_BATCH: IF (@@ERROR <> 0) BEGIN ROLLBACK TRAN END ELSE BEGIN COMMIT TRAN END Listing 4.2 unregisterSite stored procedure (continued) The getRegisteredSites Stored Procedure This procedure is used by the log collector service (through our data-access compo- nent) to retrieve the list of sites for which logs need to be collected. It is also used by the ASP.NET application to retrieve the list of available sites on a specific computer. The stored procedure is defined in Listing 4.3. CREATE PROCEDURE dbo.getRegisteredSites ( @MachineName nvarchar(15) = NULL ) AS IF (@MachineName IS NULL) SELECT [ID], [MachineName], [SiteIndex], CONVERT(nvarchar(25), [MachineName] + N’W3SVC’ + CONVERT(nvarchar(5), [SiteIndex])) AS [EntriesTable], CONVERT(nvarchar(256), NULL) AS [SiteName], CONVERT(nvarchar(512), NULL) As [LogFileDirectory], CONVERT(bit, 1) AS [Registered] FROM [LogSite] ORDER BY [MachineName], [SiteIndex] ELSE SELECT [ID], [MachineName], [SiteIndex], CONVERT(nvarchar(25), [MachineName] + N’W3SVC’ + CONVERT(nvarchar(5), [SiteIndex])) AS [EntriesTable], CONVERT(nvarchar(256), NULL) AS [SiteName], CONVERT(nvarchar(512), NULL) As [LogFileDirectory], CONVERT(bit, 1) AS [Registered] FROM [LogSite] WHERE [MachineName] = @MachineName ORDER BY [SiteIndex] RETURN Listing 4.3 getRegisteredSites stored procedure The next few stored procedures are used by the log collector service to add, retrieve, and update the list of available log sources (individual log files). The ASP.NET application 176 Project 4 uses the getSources stored procedure to show the user a list of sources and their status for a given site. The addSource Stored Procedure This procedure is used by the log collector service to add a new log source that was detected in the file system. Notice that we’re setting the transaction isolation level to Serializable for the duration of this procedure. This way, we can make sure that two instances of the log collector service, running on different computers, cannot add the same log source twice. If this type of attempt is made, the second (unsuccessful) oper- ation will receive the correct log source ID in the output parameter. The stored proce- dure is defined in Listing 4.4. CREATE PROCEDURE dbo.addSource ( @SourceID uniqueidentifier = NULL OUTPUT, @Site uniqueidentifier, @FilePath nvarchar(512), @Status nvarchar(20) = N’PENDING’, @Parser nvarchar(15) = NULL, @LineNumber int = 0, @Length bigint = 0, @LastWrite datetime, @ReProc bit = 0, @Comment nvarchar(256) = N’This file has not yet been processed.’ ) AS SET TRANSACTION ISOLATION LEVEL SERIALIZABLE BEGIN TRAN IF EXISTS(SELECT * FROM [LogSource] WHERE [FilePath] = @FilePath AND [Site] = @Site) SELECT @SourceID = [ID] FROM [LogSource] WHERE [FilePath] = @FilePath AND [Site] = @Site ELSE INSERT INTO [LogSource] ([ID], [Site], [FilePath], [Status], [Parser], [LineNumber], [Length], [LastWrite], [ReProc], [Comment]) VALUES (@SourceID, @Site, @FilePath, @Status, @Parser, @LineNumber, @Length, @LastWrite, @ReProc, @Comment) IF (@@ERROR <> 0) BEGIN ROLLBACK TRAN SET @SourceID = NULL END ELSE BEGIN COMMIT TRAN END SET TRANSACTION ISOLATION LEVEL READ COMMITTED Listing 4.4 addSource stored procedure Building the Web Log Analyzer 177 The updateSource Stored Procedure This procedure is used by the log collector service to update a log source in response to processing activity or activity that was detected in the file system. The stored proce- dure is defined in Listing 4.5. CREATE PROCEDURE dbo.updateSource ( @SourceID uniqueidentifier OUTPUT, @Site uniqueidentifier, @FilePath nvarchar(512), @Status nvarchar(20), @Parser nvarchar(15), @LineNumber int, @Length bigint, @LastWrite datetime, @ReProc bit, @Comment nvarchar(256) = NULL ) AS BEGIN TRAN UPDATE [LogSource] SET [ID] = @SourceID, [Site] = @Site, [FilePath] = @FilePath, [Status] = @Status, [Parser] = @Parser, [LineNumber] = @LineNumber, [Length] = @Length, [LastWrite] = @LastWrite, [ReProc] = @ReProc, [Comment] = @Comment WHERE [ID] = @SourceID IF (@@ERROR <> 0) BEGIN ROLLBACK TRAN END ELSE BEGIN COMMIT TRAN END RETURN Listing 4.5 updateSource stored procedure The getSources Stored Procedure This procedure is used by the log collector service upon initialization to retrieve a list of log sources that are already registered in the database. It is also used by the ASP.NET application to retrieve a list of log sources and their status for a particular site. The stored procedure is defined in Listing 4.6. 178 Project 4 CREATE PROCEDURE dbo.getSources ( @SiteID uniqueidentifier = NULL ) AS IF (@SiteID IS NULL) SELECT [LogSource].[ID], [Site], [FilePath], [Status], [Parser], [LineNumber], [Length], [LastWrite], [ReProc], [Comment] FROM [LogSource] INNER JOIN [LogSite] ON [LogSource].[Site] = [LogSite].[ID] ORDER BY [LogSite].[SiteIndex] ELSE SELECT [ID], [Site], [FilePath], [Status], [Parser], [LineNumber], [Length], [LastWrite], [ReProc], [Comment] FROM [LogSource] WHERE [Site] = @SiteID ORDER BY [FilePath] Listing 4.6 getSources stored procedure The addEntry Stored Procedure The following stored procedure is used by the log collector service to add individual log entries to the database. The log entry table is selected dynamically by the proce- dure. IIS stores its log files as plain text, but to reduce the size of the data stored in the logs, most of the fields are reduced to their numeric equivalents. The stored procedure is defined in Listing 4.7. CREATE PROCEDURE dbo.addEntry ( @EntryTable nvarchar(25) = NULL OUTPUT, @Source uniqueidentifier, @SourceLine int, @dateTime datetime = NULL, @cIp int = NULL, @csUsername nvarchar(36) = NULL, @sSitename varchar(12) = NULL, @sComputername nvarchar(15) = NULL, @sIp int = NULL, @sPort int = NULL, @csMethod varchar(10) = NULL, @csUriStem nvarchar(512) = NULL, @csUriQuery nvarchar(2048) = NULL, @scStatus smallint = NULL, @scWin32Status int = NULL, @scBytes int = NULL, @csBytes int = NULL, @timeTaken int = NULL, @csVersion varchar(20) = NULL, @csHost nvarchar(256) = NULL, @csUserAgent nvarchar(256) = NULL, Listing 4.7 addEntry stored procedure Building the Web Log Analyzer 179 @csCookie nvarchar(2048) = NULL, @csReferer nvarchar(512) = NULL ) AS SET NOCOUNT ON BEGIN TRAN DECLARE @SQLStatement nvarchar(2000) DECLARE @ParamDefinitions nvarchar(2000) DECLARE @tmpCsUriStem uniqueidentifier DECLARE @tmpCsUriQuery uniqueidentifier DECLARE @tmpCsHost uniqueidentifier DECLARE @tmpCsUserAgent uniqueidentifier DECLARE @tmpCsCookie uniqueidentifier DECLARE @tmpCsReferer uniqueidentifier SELECT @tmpCsUriStem = [ID] FROM [URIStem] WHERE [cs-uri-stem] = @csUriStem SELECT @tmpCsUriQuery = [ID] FROM [URIQuery] WHERE [cs-uri-query] = @csUriQuery SELECT @tmpCsHost = [ID] FROM [Host] WHERE [cs-host] = @csHost SELECT @tmpCsUserAgent = [ID] FROM [UserAgent] WHERE [cs(User-Agent)] = @csUserAgent SELECT @tmpCsCookie = [ID] FROM [Cookie] WHERE [cs(Cookie)] = @csCookie SELECT @tmpCsReferer = [ID] FROM [Referer] WHERE [cs(Referer)] = @csReferer IF ((@csUriStem IS NOT NULL) AND (@tmpCsUriStem IS NULL)) BEGIN SET @tmpCsUriStem = NEWID() INSERT INTO URIStem ([ID], [cs-uri-stem]) VALUES (@tmpCsUriStem, @csUriStem) IF (@@ERROR <> 0) GOTO EXIT_BATCH END IF ((@csUriQuery IS NOT NULL) AND (@tmpCsUriQuery IS NULL)) BEGIN SET @tmpCsUriQuery = NEWID() INSERT INTO URIQuery ([ID], [cs-uri-query]) VALUES (@tmpCsUriQuery, @csUriQuery) IF (@@ERROR <> 0) GOTO EXIT_BATCH END IF ((@csHost IS NOT NULL) AND (@tmpCsHost IS NULL)) BEGIN SET @tmpCsHost = NEWID() INSERT INTO Host ([ID], [cs-host]) VALUES (@tmpCsHost, @csHost) IF (@@ERROR <> 0) GOTO EXIT_BATCH END IF ((@csUserAgent IS NOT NULL) AND (@tmpCsUserAgent IS NULL)) Listing 4.7 addEntry stored procedure (continued) 180 Project 4 BEGIN SET @tmpCsUserAgent = NEWID() INSERT INTO UserAgent ([ID], [cs(User-Agent)]) VALUES (@tmpCsUserAgent, @csUserAgent) IF (@@ERROR <> 0) GOTO EXIT_BATCH END IF ((@csCookie IS NOT NULL) AND (@tmpCsCookie IS NULL)) BEGIN SET @tmpCsCookie = NEWID() INSERT INTO Cookie ([ID], [cs(Cookie)]) VALUES (@tmpCsCookie, @csCookie) IF (@@ERROR <> 0) GOTO EXIT_BATCH END IF ((@csReferer IS NOT NULL) AND (@tmpCsReferer IS NULL)) BEGIN SET @tmpCsReferer = NEWID() INSERT INTO Referer ([ID], [cs(Referer)]) VALUES (@tmpCsReferer, @csReferer) IF (@@ERROR <> 0) GOTO EXIT_BATCH END IF (@EntryTable IS NULL) SELECT @EntryTable = CONVERT(nvarchar(25), [MachineName] + N’W3SVC’ + CONVERT(nvarchar(5), [SiteIndex])) FROM [LogSite] INNER JOIN [LogSource] ON [LogSite].[ID] = [LogSource].[Site] WHERE [LogSource].[ID] = @Source IF (@EntryTable IS NULL) BEGIN RAISERROR(N’No site is defined for this source.’, 16, 1) GOTO EXIT_BATCH END SET NOCOUNT OFF SET @SQLStatement = N’INSERT INTO ‘ + @EntryTable + ‘ ([Source], [date-time], [c-ip], [cs-username], [s-sitename], [s-computername], [s-ip], [s-port], [cs-method], [cs-uri-stem], [cs-uri-query], [sc-status], [sc-win32-status], [sc-bytes], [cs-bytes], [time-taken], [cs-version], [cs-host], [cs(User-Agent)], [cs(Cookie)], [cs(Referer)]) VALUES (@Source, @dateTime, @cIp, @csUsername, @sSiteName, @sComputername, @sIp, @sPort, @csMethod, @tmpCsUriStem, @tmpCsUriQuery, @scStatus, @scWin32Status, @scBytes, @csBytes, @timeTaken, @csVersion, @tmpCsHost, @tmpCsUserAgent, @tmpCsCookie, @tmpCsReferer)’ SET @ParamDefinitions = N’@Source uniqueidentifier, @SourceLine int, @dateTime datetime, @cIp int, @csUsername nvarchar(36), @sSitename varchar(12), @sComputername nvarchar(15), @sIp int, @sPort int, Listing 4.7 addEntry stored procedure (continued) Building the Web Log Analyzer 181 @csMethod varchar(10), @tmpCsUriStem uniqueidentifier, @tmpCsUriQuery uniqueidentifier, @scStatus smallint, @scWin32Status int, @scBytes int, @csBytes int, @timeTaken int, @csVersion varchar(20), @tmpCsHost uniqueidentifier, @tmpCsUserAgent uniqueidentifier, @tmpCsCookie uniqueidentifier, @tmpCsReferer uniqueidentifier’ EXECUTE sp_executesql @SQLStatement, @ParamDefinitions, @Source, @SourceLine, @dateTime, @cIp, @csUsername, @sSitename, @sComputername, @sIp, @sPort, @csMethod, @tmpCsUriStem, @tmpCsUriQuery, @scStatus, @scWin32Status, @scBytes, @csBytes, @timeTaken, @csVersion, @tmpCsHost, @tmpCsUserAgent, @tmpCsCookie, @tmpCsReferer SET NOCOUNT ON UPDATE [LogSource] SET [LineNumber] = @SourceLine WHERE [ID] = @Source EXIT_BATCH: IF (@@ERROR <> 0) ROLLBACK TRAN ELSE COMMIT TRAN Listing 4.7 addEntry stored procedure (continued) The scrubDatabase Stored Procedure This utility procedure can be used while you are testing the log collector service to scrub the database between test runs. The stored procedure is defined in Listing 4.8. CREATE PROCEDURE scrubDatabase ( @IncludeSiteRegistrations bit = 0 ) AS BEGIN TRAN DECLARE @TableName nvarchar(25) DECLARE @SQLStatement nvarchar(2000) DECLARE sites CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR SELECT CONVERT(nvarchar(25), [MachineName] + N’W3SVC’ + CONVERT(nvarchar(5), [SiteIndex])) AS [TableName] FROM [LogSite] OPEN sites FETCH NEXT FROM sites INTO @TableName Listing 4.8 scrubDatabase stored procedure 182 Project 4 TEAMFLY Team-Fly ® WHILE @@FETCH_STATUS = 0 BEGIN IF EXISTS(SELECT * FROM dbo.sysobjects WHERE [ID] = OBJECT_ID(@TableName) AND OBJECTPROPERTY([ID], N’IsUserTable’) = 1) BEGIN IF (@IncludeSiteRegistrations = 1) BEGIN SET @SQLStatement = N’DROP TABLE ‘ + @TableName EXECUTE sp_executesql @SQLStatement SET @SQLStatement = N’DROP VIEW vw_’ + @TableName EXECUTE sp_executesql @SQLStatement END ELSE BEGIN SET @SQLStatement = N’DELETE FROM ‘ + @TableName EXECUTE sp_executesql @SQLStatement END END FETCH NEXT FROM sites INTO @TableName END DELETE FROM URIStem DELETE FROM URIQuery DELETE FROM Host DELETE FROM Referer DELETE FROM Cookie DELETE FROM UserAgent DELETE FROM LogSource IF (@IncludeSiteRegistrations = 1) DELETE FROM LogSite IF (@@ERROR <> 0) ROLLBACK TRAN ELSE COMMIT TRAN Listing 4.8 scrubDatabase stored procedure (continued) Finally, let’s go ahead and define some of the reports that will be available to our ASP.NET application. The SQL for these reports may be a bit hard to follow, so I would suggest downloading the code for these items from the Web site. In all of these, we are using dynamically defined queries and the sp_executesql stored procedure, so the report will work for any given site’s log entry table. The four reports are HitsByClient, HitsByUserAgent, PageHitsByFrequency, and RequestsForExecutables. The complete stored procedures are shown in Listings 4.9, 4.10, 4.11, and 4.12. Building the Web Log Analyzer 183 CREATE PROCEDURE HitsByClient ( @TableName nvarchar(25), @StartDate datetime = NULL, @EndDate datetime = NULL ) AS DECLARE @SQLStatement nvarchar(2000) DECLARE @ParamDefs nvarchar(2000) SET @SQLStatement = ‘SELECT DISTINCT [c-ip] AS [Client IP], CONVERT( nvarchar(512), NULL) AS [Client Domain], COUNT([c-ip]) AS Hits, CONVERT(nvarchar(10), CONVERT(decimal(5, 3), (CONVERT(decimal(24, 4), COUNT([c-ip])) / CONVERT(decimal(24, 4), (SELECT SUM(a.Hits) AS Total FROM (SELECT DISTINCT [c-ip] AS [Client IP], COUNT([c-ip]) AS [Hits] FROM vw_’ + @TableName + ‘ a WHERE a.[date-time] BETWEEN CONVERT( datetime, @StartDate) AND CONVERT(datetime, @EndDate) AND NOT a.[c-ip] IS NULL GROUP BY [c-ip]) AS a)) * 100))) + ‘’%’’ AS [Percentage] FROM vw_’ + @TableName + ‘ WHERE [date-time] BETWEEN CONVERT(datetime, @StartDate) AND CONVERT(datetime, @EndDate) AND NOT [c-ip] IS NULL GROUP BY [c-ip] ORDER BY [c-ip]’ SET @ParamDefs = ‘@StartDate datetime, @EndDate datetime’ IF (@StartDate IS NULL) SET @StartDate = CONVERT(datetime, ‘1/1/1753’) IF (@EndDate IS NULL) SET @EndDate = CONVERT(datetime, ‘12/31/9999 11:59:59’) EXECUTE sp_executesql @SQLStatement, @ParamDefs, @StartDate, @EndDate Listing 4.9 HitsByClient stored procedure CREATE PROCEDURE HitsByUserAgent ( @TableName nvarchar(25), @StartDate datetime = NULL, @EndDate datetime = NULL ) AS DECLARE @SQLStatement nvarchar(2000) DECLARE @ParamDefs nvarchar(2000) SET @SQLStatement = ‘SELECT DISTINCT UserAgent.[cs(User-Agent)] AS [User Agent / Browser Type], COUNT(UserAgent.[cs(User-Agent)]) AS Hits, CONVERT(nvarchar(10), CONVERT(decimal(5, 3), CONVERT( decimal(24, 4), COUNT(UserAgent.[cs(User-Agent)])) / CONVERT( decimal(24, 4), (SELECT SUM(a.Hits) AS Total FROM (SELECT DISTINCT UserAgent.[cs(User-Agent)] AS [User Agent / Browser Type], COUNT( UserAgent.[cs(User-Agent)]) AS [Hits] FROM vw_’ + @TableName + ‘ i LEFT JOIN UserAgent ON i.[cs(User-Agent)] = UserAgent.[ID] WHERE i.[date-time] BETWEEN CONVERT(datetime, @StartDate) AND CONVERT( Listing 4.10 HitsByUserAgent stored procedure 184 Project 4 [...]... ‘@StartDate datetime, @EndDate datetime’ IF (@StartDate IS NULL) SET @StartDate = CONVERT(datetime, ‘1/1/1753’) IF (@EndDate IS NULL) SET @EndDate = CONVERT(datetime, ‘12/31/9999 11:59:59’) EXECUTE sp_executesql @SQLStatement, @ParamDefs, @StartDate, @EndDate Listing 4 .10 HitsByUserAgent stored procedure (continued) CREATE PROCEDURE PageHitsByFrequency ( @TableName nvarchar(25), @StartDate datetime... procedure 185 186 Project 4 URIStem.[cs-uri-stem]) AS a)) * 100 )) > 1 ORDER BY URIStem.[cs-uri-stem]’ SET @ParamDefs = ‘@StartDate datetime, @EndDate datetime’ IF (@StartDate IS NULL) SET @StartDate = CONVERT(datetime, ‘1/1/1753’) IF (@EndDate IS NULL) SET @EndDate = CONVERT(datetime, ‘12/31/9999 11:59:59’) EXECUTE sp_executesql @SQLStatement, @ParamDefs, @StartDate, @EndDate Listing 4. 11 PageHitsByFrequency... shown in Figure 4. 15 Figure 4. 13 Authentication Methods dialog box Building the Web Log Analyzer Figure 4. 14 ASP.NET Web Application project dialog box 14 Before you continue creating the other project types, open the AssemblyInfo.vb file, and set the assembly’s attributes as you have done in previous projects For the AssemblyTitle attribute, type ASP.NET At Work - Web Log Analyzer 15 At this point,... LIKE ‘’%.bat’’ OR (CASE WHEN URIQuery.[cs-uri-query] IS NULL THEN URIStem.[cs-uri-stem] ELSE URIStem.[cs-uri-stem] + ‘’?’’ + URIQuery.[cs-uri-query] END) LIKE ‘’%.bat?%’’ AND a.[date-time] BETWEEN CONVERT(datetime, @StartDate) AND CONVERT(datetime, @EndDate) ORDER BY [sc-status], [c-ip]’ SET @ParamDefs = ‘@StartDate datetime, @EndDate datetime’ IF (@StartDate IS NULL) SET @StartDate = CONVERT(datetime,... dialog box shown in Figure 4. 11 will appear Figure 4. 9 Virtual directory alias screen Building the Web Log Analyzer Figure 4 .10 Physical directory entry screen 9 IIS should have automatically created your virtual directory as a Web Application, but if it hasn’t, you can click the Create button to have one created for you Next, click the Directory Security tab shown in Figure 4. 12 10 Since Web logs can... are as follows: 1 Create the Web Application in IIS and a new ASP.NET Web Application project in Visual Studio NET 2 Create and build the WebLogParser Class Library project 3 Create and build the WebLogDataAccess Class Library project 4 Create, build, install, and test the LogCollector Windows Service project 5 Develop, build, and test the ASP.NET Web Application 187 188 Project 4 Setting Up the Development... filePath As String, _ As LogParser Dim objFileInfo As FileInfo Dim strFileName As String Dim strFileExt As String If filePath = Nothing Then Throw New ArgumentNullException(“filePath”) If Not File.Exists(filePath) Then Throw New FileNotFoundException(“The log file was not found.”, _ filePath) Listing 4. 22 Code for LogParser.vb (continued) 209 210 Project 4 Else filePath = Path.GetFullPath(filePath)... a.[cs-uri-stem] = URIStem.[ID] WHERE a.[date-time] BETWEEN CONVERT(datetime, @StartDate) AND CONVERT(datetime, @EndDate) GROUP BY URIStem.[cs-uri-stem]) AS a)) * 100 ))) + ‘’%’’ AS [Percentage of Hits] FROM vw_’ + @TableName + ‘ a INNER JOIN URIStem ON a.[cs-uri-stem] = URIStem.[ID] WHERE a.[date-time] BETWEEN CONVERT(datetime, @StartDate) AND CONVERT(datetime, @EndDate) GROUP BY URIStem.[cs-uri-stem] HAVING... CONVERT(datetime, ‘1/1/1753’) IF (@EndDate IS NULL) SET @EndDate = CONVERT(datetime, ‘12/31/9999 11:59:59’) EXECUTE sp_executesql @SQLStatement, @ParamDefs, @StartDate, @EndDate Listing 4. 12 RequestsForExecutables stored procedure (continued) Now, we are ready to begin setting up our development environment The first project that we will set up will be the ASP.NET Web application, although it will be the last... Figure 4. 13 Figure 4. 11 Virtual directory properties dialog box 189 190 Project 4 Figure 4. 12 Directory Security tab 11 It is important that you make sure that the Anonymous access check box is not selected As you can see in Figure 4. 13, I have also selected all of the authentication types supported by IIS under the Authenticated Access heading 12 Now that you have your IIS Web Application set up, close . shown in Listings 4. 9, 4 .10, 4. 11, and 4. 12. Building the Web Log Analyzer 183 CREATE PROCEDURE HitsByClient ( @TableName nvarchar(25), @StartDate datetime = NULL, @EndDate datetime = NULL ) AS. CONVERT(datetime, @StartDate) AND CONVERT(datetime, @EndDate) ORDER BY [sc-status], [c-ip]’ SET @ParamDefs = ‘@StartDate datetime, @EndDate datetime’ IF (@StartDate IS NULL) SET @StartDate = CONVERT(datetime,. one shown in Figure 4. 15. Figure 4. 13 Authentication Methods dialog box. 190 Project 4 Figure 4. 14 ASP. NET Web Application project dialog box. 14. Before you continue creating the other project

Ngày đăng: 12/08/2014, 08:23

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan