C 讀取Windows日誌

2022-03-05 10:15:06 字數 1273 閱讀 6733

using

system;

using

system.data;

using

system.configuration;

using

system.collections;

using

system.web;

using

system.web.security;

using

system.web.ui;

using

system.web.ui.webcontrols;

using

system.web.ui.webcontrols.webparts;

using

system.web.ui.htmlcontrols;

using

system.text;

using

system.diagnostics;

public

partial

class

default3 : system.web.ui.page

;stringbuilder result

=new

stringbuilder();

foreach

(string

log

inlogs)}}

response.write(result.tostring());}}

輸出結果:

(2007-6-16 16:25:49):event code: 3005 event message: 發生了未處理的異常。 event time: 2007-6-16 16:25:49 event time (utc)

systemwarning

(2007-6-16 10:34:15):瀏覽器服務不能從在網路 \device\netbt_tcpip_ 上的主瀏覽器 \\qianting01 上檢索伺服器列表。 主瀏覽器: \\qianting01 網路: \device\netbt_tcpip_ 此事件可能是由於暫時丟失網路連線造成的。如果此訊息再次出現,請確認伺服器仍然與網路連線。返回碼在資料文字框中。

systemerror

(2007-6-16 10:34:45):瀏覽器服務已很多次無法在 \device\netbt_tcpip_ 傳輸上捕獲備份列表。備份瀏覽器已經停止。

systemerror

(2007-6-16 15:40:30):瀏覽器服務已很多次無法在 \device\netbt_tcpip_ 傳輸上捕獲備份列表。備份瀏覽器已經停止。

讀取日誌檔案

represents the log level,level of value 4 is the most important public enum loglevel int 讀取日誌檔案 filemanager.instance createdirectoryfrompath pathdirlo...

C 寫Windows系統日誌(EventLog)

net framework 2.0開始,可以使用 event log建構函式在windows系統日誌 裡新增內容,一切看上去是如此的簡單。只是 會涉及到一點點的許可權問題,必須要注意一下。使用event log時,涉及到乙個叫做 source 的引數 一般用來記錄訊息的出處 比如將該引數設為 mye...

C 讀取Windows登錄檔資訊

登錄檔是視窗系統的乙個核心的資料庫,在這個資料庫中存放中與系統相關的各種引數,這些引數直接控制中系統的啟動 硬體的驅動程式安裝資訊以及在視窗系統上執行的各種應用程式的註冊資訊等。這就意味著,如果登錄檔因為某些原因受到了破壞,輕者是視窗系統啟動過程出現異常,重者就有可能導致整個系統的完全癱瘓。所以正確...