亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? eventlog_article.htm

?? Complete example using custom errors and write errors to the Event log 日志記錄
?? HTM
字號:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 2</title>
</head>

<body>
<h1 align="center">Complete example using custom errors and write errors to the Event log</h1>
<p>Writing to the Windows 2000 Event Log is a powerful feature of the ASP.NET and
.NET framework.&nbsp; For those individuals who work in a large company and want
to make track application errors, writing to the event log is a must!</p>
<p>There wasn't any complete demos actually showing from A - Z how this was
setup for the novice/common developer like me.   Most novice developers need
to be spoon fed how things are done the first time, once they see a simple
example, they'll understand how the process works!   This example is my
reference how to make a complete application from A - Z setup and fail to
understand how it works.</p>

<table width="100%">
<tr><td>  </td>
<td><a href="/allzips/eventlogdotnet.zip"><img src='http://aspfree.com/images/downloadcode.gif' alt='downloadcode.gif (1195 bytes)' border='0' width='131' height='28'></a>
</td>
</tr>
</table>

<hr align="center" width="80%">

<h1><b>Step 1</b></h1>
<p>First of all the steps I followed was to create a simple web called <b><font color="#FF0000">eventlog.</font></b>
I also created the application rootso the global.asax file would fire.<br>(<a href="/aspnet/createapproot.aspx">Click here if you don't know how to create an application root)</a></p>
<p><img border="0" src="http://aspfree.com/images/eventlog1.gif"></p>
<h1>Step 2</h1>

I opened the global config.web file and turned on custom errors. Path to this
is <b>c:\winnt\microsoft.net\framework\..</b> There are 3 choices available currently
<i>On, Off and RemoteOnly</i>.  From attending the conference, the
recommended was <b>RemoteOnly</b>. This means anyone not on the console of
the machine will see a friendly error and not the real thing.   For this
example I chose <b>On</b>.  You also could leave the global config.web file
custom errors turned off and configure at application level's web.config Either
way works just fine.
<br><br>
<b>Config.web -- this file is placed in the root of the \eventlog application
root.</b>
<p>&lt;configuration>&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;system.web><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;customErrors mode="On" defaultRedirect="/eventlog/customerrorpage.aspx"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;error statusCode=&quot;404&quot; redirect=&quot;/eventlog/404Page.aspx&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;error statusCode="403" redirect="/eventlog/403page.aspx"/><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/customErrors>&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/system.web><br>
&lt;/configuration>&nbsp;</p>

<h1>Step 3</h1>
The next few items are just to create sample pages to make the application
complete. I created a <b>config.web, global.asax, Default.aspx page</b>,
and three sample error pages. <b>404page.aspx, 403page.aspx </b>and<b>
customerrorpage.aspx page.</b><br><br>
Here are those pages code for all pages.
<p><b><i>Global.asax Page - </i>This uses the Application_OnError event to capture
stuff if an error happens</b></p>
<p>&lt;%@ Import Namespace="System" %><br>
&lt;%@ Import Namespace="System.Diagnostics" %><br>
&lt;script language="VB" runat=server><br>
<br>
Public Sub Application_OnError(Sender as Object, E as EventArgs)<br>
<b>'Captures the error and converts to a string</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dim LastError as Exception = Server.GetLastError()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim ErrMessage as String = LastError.toString()<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim LogName As String = "MyLog"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Message As String = "Url " &amp; Request.Path &amp; " Error: " &amp; ErrMessage<br>
<br>
<b>' Create Event Log if It Doesn't Exist<br>
</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (Not EventLog.SourceExists(LogName)) Then<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
EventLog.CreateEventSource(LogName, LogName)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End if<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Log as New EventLog<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Log.Source = LogName<br>
<br>
<b>	 'These are the five options that will display a different icon.<br>
'The numbers are just to show the order.&nbsp; These aren't required<br>
</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Log.WriteEntry(Message,
EventLogEntryType.Information, 1)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Log.WriteEntry(Message,
EventLogEntryType.Error, 2)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '       Log.WriteEntry(Message, EventLogEntryType.Warning, 3)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '       Log.WriteEntry(Message, EventLogEntryType.SuccessAudit, 4)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Log.WriteEntry(Message,
EventLogEntryType.FailureAudit, 5)<br>
End Sub<br>
&lt;/script></p>
<p><b>Default.aspx page</b></p>
<p>&lt;html><br>
&lt;head><br>
&lt;/head><br>
&lt;body><br>
&lt;form method="post" action="eventlog.aspx" name="form1" id="number"><br>
<br>
&lt;asp:Button id="abutton" type="submit" text="Click Me to generate an error" runat="server" /><br>
&lt;/form><br>
&lt;/body><br>
&lt;/html></p>
<p><b>Eventlog.aspx page -- This raises the Error!</b><br>
<br>
&lt;% @Language="VB" %><br>
&lt;script language="VB" runat=server><br>
	Sub Page_Load(Sender As Object, E As EventArgs)<br>
<br>
<b>       'Declare all variables<br>
</b>       dim x as integer<br>
       dim y as integer<br>
       dim z as integer<br>
<br>
       <b>'set x and y to values to be divided by zero<br>
</b>       x = 1<br>
       y = 0<br>
<br>
<b>       'perform the division by zero to raise the error<br>
</b>       z = x/y<br>
<br>
	End Sub<br>
&lt;/script><br>
&lt;html><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;head>&lt;/head><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;body><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Stuff was added to the event log<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/body><br>
&lt;/html><br>
<b><br>
Customerrorpage.aspx</b>
</p>
<p>&lt;html><br>
&nbsp;&nbsp;&nbsp; &lt;head>&lt;/head><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;body><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;h1>custom error page&lt;/h1><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/body><br>
&lt;/html><br>
<br>
<b>404page.aspx --Capture all 404(Not Found pages)</b>
</p>
<p>&lt;html><br>
&nbsp;&nbsp;&nbsp; &lt;head>&lt;/head><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;body><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;h1&gt;404 error page&lt;/h1><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/body><br>
&lt;/html><br>
<br>
<b>403page.aspx --Capture all 403(Restricted pages)</b>
</p>
<p>&lt;html><br>
&nbsp;&nbsp; &lt;head>&lt;/head><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;body><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;h1&gt;403 error page&lt;/h1><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/body><br>
&lt;/html>
</p>
<h1>Step 4</h1>

After all webs are created, config.web files in place. It was time to test out the
application to see if it works.  Type in http://localhost/eventlog/default.aspx file, this will display a 
button.  Click it and see if this
actually creates the log and writes the information to the event log.
Actually only the custom error page will be displayed, the eventlog.aspx page will error and be transfered
to the customerrorpage.aspx.   The URL will be
something like this.   <br><br>
<b>http://localhost/eventlog/customerrorpage.aspx?aspxerrorpath=/eventlog/eventlog.aspx</b>
<p>The page will appear like this</p>
<p><img border="0" src="http://aspfree.com/images/eventlog2.gif"></p>
<h1>Step 5. </h1>
Verify the log was created and entry was placed in that log. The
example shows a <font color="#FF0000"><b>Critical</b></font> error
message.  You also can show <b><font color="#0000FF">informational</font></b>
or <font color="#000000"><b>yellow</b></font><font color="#FFFF00"> </font>warning
messages.&nbsp; For this example we showed all 5 possible entries<br><br>
<p><img border="0" src="http://aspfree.com/images/eventlog3.gif"><br>
Open the Error and view the message.   If the customerror wasn't turned on, this error 
would have shown up in the browser instead of the eventlog.   Not pretty!!
<br><br>
<p><img border="0" src="http://aspfree.com/images/eventlog4.gif"></p>
<p>Thats it!  This was a high-level example with examples but hopefully
helps in understanding how a sample application and using the new Error-handling
features of ASP.NET... Enjoy!!<br>
<hr width="75%">
<h4 class="dtH4">Parameters for WriteEntry Method</h4>
<dl>
  <dt><i>source</i>
  <dd>The source by which the application is registered on the specified
    computer.
  <dt><i>message</i>
  <dd>The string to write to the event log.
  <dt><i>type</i>
  <dd>One of the EventLogEntryType values.
  <dt><i>eventID</i>
  <dd>The application-specific identifier for the event.
  <dt><i>category</i>
  <dd>The application-specific subcategory associated with the message.
  <dt><i>rawData</i>
  <dd>An array of bytes that holds the binary data associated with the entry.</dd>
</dl>
<p><b>Five possible types of Event log messages.&nbsp; These show the different
types of icons</b></p>
<table class="dtTABLE" cellSpacing="0">
  <tbody>
    <tr vAlign="top">
      <th>Member Name</th>
      <th>Description</th>
    </tr>
    <tr vAlign="top">
      <td><b>Error</b></td>
      <td>An error event. This indicates a significant problem the
        user should know about; usually a loss of functionality or data.</td>
    </tr>
    <tr vAlign="top">
      <td><b>FailureAudit</b></td>
      <td>A failure audit event. This indicates a security event
        that occurs when an audited access attempt fails; for example, a failed
        attempt to open a file.</td>
    </tr>
    <tr vAlign="top">
      <td><b>Information</b></td>
      <td>An information event. This indicates a significant,
        successful operation.</td>
    </tr>
    <tr vAlign="top">
      <td><b>SuccessAudit</b></td>
      <td>A success audit event. This indicates a security event
        that occurs when an audited access attempt is successful; for example,
        logging on successfully.</td>
    </tr>
    <tr vAlign="top">
      <td><b>Warning</b></td>
      <td>A warning event. This indicates a problem that is not
        immediately significant, but that may signify conditions that could
        cause future problems.</td>
    </tr>
  </tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp; 


</body>

</html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人午夜精品5599 | 日韩精品专区在线影院观看| 成人一级片网址| 国产精品一区久久久久| 国产美女视频一区| 成人国产精品视频| 不卡的av在线| 色综合激情久久| 欧美日韩国产一二三| 欧美一区二区三区视频在线| 日韩免费一区二区| 久久久噜噜噜久噜久久综合| 国产精品热久久久久夜色精品三区| 亚洲国产精品精华液2区45| 亚洲天堂av老司机| 亚洲成人一区二区| 国产主播一区二区| 一本大道久久a久久精二百| 欧美伊人久久大香线蕉综合69| 9191成人精品久久| 国产欧美综合在线观看第十页| 国产精品久线在线观看| 亚洲一区av在线| 久久精品国产99国产精品| 丁香五精品蜜臀久久久久99网站| 99久久婷婷国产| 欧美一区二区三区人| 国产午夜精品久久久久久久| 一区二区三区四区亚洲| 麻豆91在线看| 一本久道久久综合中文字幕 | 成人免费三级在线| 在线看一区二区| 久久一区二区三区国产精品| 亚洲色图制服丝袜| 久久超级碰视频| 色婷婷久久综合| 一区二区三区四区不卡在线| 精品一区二区三区久久| 色系网站成人免费| 欧美极品aⅴ影院| 午夜视黄欧洲亚洲| 成人午夜碰碰视频| 日韩女优视频免费观看| 亚洲二区在线观看| a4yy欧美一区二区三区| 精品国产免费一区二区三区香蕉| 亚洲黄色片在线观看| 国产精品一区二区免费不卡 | 国产毛片精品国产一区二区三区| 在线精品视频免费播放| 国产拍欧美日韩视频二区| 蜜桃久久久久久久| 欧美视频一区在线观看| 亚洲色图另类专区| 成人av电影在线网| 久久综合九色综合97婷婷女人 | 国产成人福利片| 91精品国产免费| 一区二区视频在线| 成人在线视频一区| 国产亚洲欧美一区在线观看| 男女男精品视频| 欧美日本一道本| 亚洲已满18点击进入久久| 99免费精品在线观看| 国产欧美精品区一区二区三区| 精品亚洲免费视频| 日韩欧美在线123| 青娱乐精品在线视频| 在线欧美一区二区| 亚洲激情综合网| 欧美伊人精品成人久久综合97| 亚洲免费观看视频| 在线视频欧美精品| 亚洲成人动漫精品| 欧美精品18+| 毛片不卡一区二区| 久久久精品欧美丰满| 国产精品一二一区| 中文成人av在线| 99久久国产免费看| 亚洲国产欧美在线人成| 欧美电影一区二区| 久久精品国产秦先生| 国产亚洲精品久| 99国产精品99久久久久久| 亚洲色图.com| 欧美日韩黄色影视| 美女国产一区二区三区| 国产欧美日韩综合| 色噜噜狠狠成人中文综合| 一区二区三区中文在线观看| 在线成人免费观看| 国产一区在线精品| 国产精品久久毛片av大全日韩| 一本大道综合伊人精品热热| 午夜伊人狠狠久久| 精品国产一区二区亚洲人成毛片| 国产福利一区二区| 一区二区欧美精品| 亚洲色图色小说| 91精品国产麻豆国产自产在线| 国产成人午夜视频| 亚洲午夜久久久久中文字幕久| 欧美一区二区三区性视频| 风间由美一区二区av101| 亚洲综合激情网| 久久久另类综合| 欧美日韩国产大片| 成人天堂资源www在线| 五月天精品一区二区三区| 久久久精品欧美丰满| 欧美日韩电影一区| 99v久久综合狠狠综合久久| 日本女优在线视频一区二区| 国产精品久久久久毛片软件| 91精品国产综合久久久久久漫画 | 精品国产乱码久久久久久闺蜜| 亚洲成av人片| 亚洲欧洲成人精品av97| 欧美日本不卡视频| 国产不卡高清在线观看视频| 亚洲第四色夜色| 国产精品成人在线观看| 欧美va亚洲va香蕉在线| 日本精品视频一区二区三区| 国产麻豆视频一区二区| 日本不卡免费在线视频| 亚洲精品视频观看| 国产欧美日韩另类视频免费观看| 欧美日韩国产高清一区| 色婷婷精品久久二区二区蜜臀av| 国产精品99久久久久久宅男| 看片的网站亚洲| 亚洲成人av福利| 亚洲精品国产a| 中文字幕精品在线不卡| 日韩精品一区二区三区老鸭窝 | 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 欧美一区日韩一区| 欧美怡红院视频| 欧美亚洲尤物久久| 欧美性淫爽ww久久久久无| 色综合视频一区二区三区高清| 成人天堂资源www在线| 国产精品乡下勾搭老头1| 精油按摩中文字幕久久| 麻豆精品久久精品色综合| 午夜精品免费在线观看| 亚洲成人自拍偷拍| 日产精品久久久久久久性色| 亚洲.国产.中文慕字在线| 五月天久久比比资源色| 日韩一区精品字幕| 蜜臀91精品一区二区三区 | 日韩国产精品久久| 视频一区中文字幕国产| 日韩主播视频在线| 偷拍一区二区三区| 另类小说视频一区二区| 久久er精品视频| 国产suv精品一区二区三区| 不卡av电影在线播放| 91免费国产在线观看| 91视频免费看| 欧美喷潮久久久xxxxx| 久久影院午夜论| 国产精品国产三级国产aⅴ入口 | aaa亚洲精品| 色婷婷综合久久| 欧美久久一区二区| 欧美精品一区二区三区在线播放 | 色系网站成人免费| 91精品蜜臀在线一区尤物| 久久综合色婷婷| 中文字幕日韩欧美一区二区三区| 亚洲精品亚洲人成人网| 免费看欧美女人艹b| 成人免费高清在线| 欧洲精品在线观看| 精品蜜桃在线看| 亚洲女同ⅹxx女同tv| 免费成人在线播放| 成人av综合一区| 欧美日韩免费电影| 欧美国产日韩a欧美在线观看 | 成人一区二区三区视频| 欧美在线观看视频在线| 亚洲精品一区二区三区影院| 亚洲天天做日日做天天谢日日欢| 五月综合激情网| 成人免费观看男女羞羞视频| 91精品国产色综合久久不卡电影 | 国产福利精品一区二区| 欧美性感一类影片在线播放| 精品国产电影一区二区| 亚洲成av人片| bt7086福利一区国产| 精品国产一区二区在线观看|