????? ??????? ??? ??? ??????? ???????? Visual C#

?????? ????????? ?????? ?????????
???? ???????: 307024 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

???? ??? ??????? ???? ????? ????? ????? ????????? ?????? ?? ??? ??? ????? ???? ??????? ?? ???? ??????? Microsoft .NET Framework.

???????

???? ??????? ??????? ??????? ?????? ??? ????? ?????? ???????? ?????? ? ??? ??????? ???:
  • Microsoft Windows 2000 Professional, Windows 2000 Server Windows 2000 ?????? ???? ?? ???? Windows NT 4.0
  • Studio Microsoft Visual C#

??????? ??? ??? ???????

???? ????? ??????? ????? ?????? ??????? ????????? ?????? ?? ?????? ??????? ?????? ??????? ????????. ???? Windows ????? ?????? ?????? ???? ????? "???? ???????". ???????? ???? ??? ??????? ??? ????? ????? ??????? ???? ??????? ?? ????? ??????? ???????? ??????? ??? ????? ????????? ??????? ???????? ??????? ???????? ????? ??? ???????. ????? ????? ????? ??????? ?? ????? ?????? ?????? ????? ??????? ???????. ?? ??????? ??????? ??? ??? ??????? ????? ??? ????? ??? ?????? ????? ?????. ?????? ????? ???? ??????? ???????:
  1. ???? Visual Studio C#.
  2. "????? ????? ???? ???? ???? ??" Visual C "#. ???? ????? ???? ?????? ??? ???? ? ????? ??????? ????? ????? ???.
  3. ???? ?? ?? ??????? ???? ????? ????? System.dll.
  4. ??????? ??????? ???????? ??? ?????? ????? "????" ? "System.Diagnostics ???? ?? ???? ????? ????????? ?? ?????? ??????? ??? ???? ??? ?? ????????? ???????? ?????? ??. ??? ??????? ??? ???????? ??? ?? ????????? ??????.
    using System;
    using System.Diagnostics;
    					
  5. ??????? ??? ??? ??????? "? ??? ?? ???? ???? ??? ????? ?? ?????????: ?????? ?? ??? ????? ???? ???? ????? (???? ???? ????? ??? ?? ??? ??????? ??????) ?? ????? ???? ???? ?????. ????? ???? ????? ?? ??? ????? ???? ???; ??? ??? ???? ?? ????? ??????? ??? ???? ?? ??? ???? ??? ???? ????? ????? ??????.
    string sSource;
    string sLog;
    string sEvent;
    
    sSource = "dotNET Sample App";
    sLog = "Application";
    sEvent = "Sample Event";
    					
  6. ??????? ??????? ????? ????? ??? ??????? ?????? ?? ??? ??? ??????? ??????, ??, ??? ??? ?????? ??? ?????, ?????? ???? ??? ????? ?? ??? ????? ????. ?? ???? ??? ???? ??? ????? ???? ?????, ??? ????? ????? ???????? ??? ????? ??? ????? ??? ?????. ?????????? ??? ?? ???? ??? ??? ??? ??????? CreateEventSource ??? ??? ???? "??? ?????????".
    if (!EventLog.SourceExists(sSource))
    	EventLog.CreateEventSource(sSource,sLog);
    					
  7. ???? ??????? ????? ???? EventLog.WriteEntry ?????? ????? ??? ??? ???????. ????? ??? ??????? ??? ??????? overloaded ??????. ????? ????? ????????? ???????? ?????? ???? ????? ???? ???? ????? ???? ? ?????? ??? ?????? ???? ??????? ???? ???? ????? "???? ?????" ? "??? ?????:
    EventLog.WriteEntry(sSource,sEvent);
    EventLog.WriteEntry(sSource, sEvent, EventLogEntryType.Warning,  234);
    					
  8. ??? ??????? ????? ??. ?? ?????? ??????? ?? ?? ???? ?? ??? ??????? ?? "???? ???????" ???? ??????? ???????.

????? ??? ????????? ????????

using System;
using System.Diagnostics;

namespace WriteToAnEventLog_csharp
{
	/// Summary description for Class1.
	class Class1
	{
		static void Main(string[] args)
		{
			string sSource;
			string sLog;
			string sEvent;

			sSource = "dotNET Sample App";
			sLog = "Application";
			sEvent = "Sample Event";

			if (!EventLog.SourceExists(sSource))
				EventLog.CreateEventSource(sSource,sLog);

			EventLog.WriteEntry(sSource,sEvent);
			EventLog.WriteEntry(sSource, sEvent,
				EventLogEntryType.Warning, 234);
		}
	}
}
				

???????

???? ???????: 307024 - ????? ??? ??????: 20/?? ??????/1427 - ??????: 3.9
????? ???
  • Microsoft Visual C# 2008 Express Edition
  • Microsoft Visual C# 2005
  • Microsoft Visual C# .NET 2002 Standard Edition
  • Microsoft Visual C# .NET 2003 Standard Edition
????? ??????: 
kbmt kbdebug kbhowtomaster KB307024 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????307024

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com