Click here to Skip to main content
15,911,531 members
Home / Discussions / C#
   

C#

 
GeneralRunning an external program Pin
Tariq20-Nov-01 19:25
Tariq20-Nov-01 19:25 
GeneralRe: Running an external program Pin
Andreas Philipson21-Nov-01 4:20
Andreas Philipson21-Nov-01 4:20 
GeneralRe: Running an external program Pin
Tariq21-Nov-01 7:17
Tariq21-Nov-01 7:17 
GeneralRe: Running an external program Pin
Andreas Philipson21-Nov-01 8:19
Andreas Philipson21-Nov-01 8:19 
GeneralGetProcesses(string machinename) method... Pin
20-Nov-01 12:12
suss20-Nov-01 12:12 
GeneralXML in function descriptions doesn't correctly deal with less-than and greater-than Pin
Mike Morearty18-Nov-01 19:47
Mike Morearty18-Nov-01 19:47 
GeneralRe: XML in function descriptions doesn't correctly deal with less-than and greater-than Pin
Paul Watson21-Nov-01 4:57
sitebuilderPaul Watson21-Nov-01 4:57 
GeneralEventLog or System.Diagnostics classes not working.. Pin
16-Nov-01 6:26
suss16-Nov-01 6:26 
Hai,

I was testing the following code... But i get an error saying...
"The type or namespace name 'EventLog' does not exist in the class or namespace 'WriteToAnEventLog_csharp'."

Why is this so? What part am I missing? I am not using VS.NET Beta. I am using notepad to type this text and used, csc test.cs to compile the code.

Please help me....


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);
}
}
}

Thanks.
GeneralRe: EventLog or System.Diagnostics classes not working.. Pin
Andreas Philipson16-Nov-01 11:57
Andreas Philipson16-Nov-01 11:57 
GeneralRe: EventLog or System.Diagnostics classes not working.. Pin
20-Nov-01 12:15
suss20-Nov-01 12:15 
QuestionHow can show a child window whith the main window Pin
aner_glx15-Nov-01 22:31
aner_glx15-Nov-01 22:31 
GeneralRunning C# Windows Application Pin
Rick Crone15-Nov-01 6:03
Rick Crone15-Nov-01 6:03 
GeneralRe: Running C# Windows Application Pin
Nish Nishant15-Nov-01 13:41
sitebuilderNish Nishant15-Nov-01 13:41 
GeneralURL for .NET redistributable Pin
Nish Nishant15-Nov-01 13:50
sitebuilderNish Nishant15-Nov-01 13:50 
GeneralRe: Running C# Windows Application Pin
Paul Watson17-Nov-01 4:27
sitebuilderPaul Watson17-Nov-01 4:27 
GeneralRe: Running C# Windows Application Pin
5-Dec-01 22:51
suss5-Dec-01 22:51 
GeneralCalling a C++ DLL from C# Pin
Jose Fco Bonnin14-Nov-01 22:16
Jose Fco Bonnin14-Nov-01 22:16 
GeneralRe: Calling a C++ DLL from C# Pin
aner_glx15-Nov-01 22:24
aner_glx15-Nov-01 22:24 
GeneralRe: Calling a C++ DLL from C# Pin
Jose Fco Bonnin16-Nov-01 4:37
Jose Fco Bonnin16-Nov-01 4:37 
GeneralRe: Calling a C++ DLL from C# Pin
aner_glx16-Nov-01 21:39
aner_glx16-Nov-01 21:39 
GeneralWM_COPYDATA Pin
rose33712-Nov-01 19:53
rose33712-Nov-01 19:53 
GeneralC# and COM (Connection Points) Pin
Anders Molin9-Nov-01 5:35
professionalAnders Molin9-Nov-01 5:35 
Generalproblem registering class Pin
dsdsds9-Nov-01 4:13
dsdsds9-Nov-01 4:13 
GeneralRe: problem registering class Pin
rchiav9-Nov-01 5:28
rchiav9-Nov-01 5:28 
Generalwho can give me an example Pin
7-Nov-01 14:54
suss7-Nov-01 14:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.