Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
W

wurzel_cidermaker

@wurzel_cidermaker
About
Posts
6
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Window Service Problems
    W wurzel_cidermaker

    I use the [System.Timers.Timer] object in my Windows Services: - System.Timers.Timer t; void OnStart(string[] args) { t = new System.Timers.Timer(); t.Interval = 1000; t.Elapsed += new System.Timers.ElapsedEventHandler(t_Elapsed); t.Enabled = true; } void t_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { ... }

    C# com help tutorial

  • a C# Service
    W wurzel_cidermaker

    I had the same problem, I was using an MSI package to install the Service. The reason it was not showing up was because I never added "Custom Actions" to the Setup & Deployment project. Check this link out: http://msdn.microsoft.com/en-us/library/zt39148a(VS.80).aspx[^]

    C# csharp

  • LogConsole? Recommendations?
    W wurzel_cidermaker

    Here's one way, create a test project with:- 2 Forms (Form1 and DebugWindow) 1 "Logger" class. Form1 just has 2 buttons on it, 1 to write an entry to the "Logger" class, the other to "Show" the Debug form. The DebugWindow form just has a Listbox on it. The Logger class has a static method which can be called from any class in your project, which in turn writes an entry in your DebugWindow listbox. Here's the Form1 class. <<< public partial class Form1 : Form { DebugWindow dbug; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { dbug = new DebugWindow(); dbug.Show(); Logger.DebugWindow = dbug.DebugListBox; } private void button1_Click(object sender, EventArgs e) { Logger.LogIt(DateTime.Now.ToString("dd MM yyyy HH:mm:ss.fff")); } private void button2_Click(object sender, EventArgs e) { dbug.Show(); } } >>> Here's the DebugWindow class. <<< public partial class DebugWindow : Form { private ListBox _debugListbox; public DebugWindow() { InitializeComponent(); } // // hide form // private void hideToolStripMenuItem_Click(object sender, EventArgs e) { this.Hide(); } // // Properties // public ListBox DebugListBox { get { return _debugListbox; } set { _debugListbox = value; } } private void DebugWindow_Load(object sender, EventArgs e) { DebugListBox = listBox1; } } >>> Here's the Logger class. <<< class Logger { private static ListBox _debugWindow; // // Log Message // public static void LogIt(string sData) { sData = sData.Trim(); UpdateListBox(sData); } // // output to listbox // delegate void ListBoxStringAdder(string sInfp); private static void UpdateListBox(string sInfo) { int iLines = 999; if (DebugWindow.InvokeRequired) { ListBoxStringAdder lsa = new ListBoxStringAdder(UpdateListBox); DebugWind

    C# css database question

  • windows service
    W wurzel_cidermaker

    To install the Windows Service on another machine you would add a Setup project to your solution which would then create an MSI package. Run the MSI package on the target machine and this will create the Windows Service. Obviously you would need the relevant .NET Framework version on the target machine.

    C# question csharp dotnet workspace

  • System.Net.Sockets - Tracing with TraceSource class
    W wurzel_cidermaker

    I received this from Microsoft. To configure you the listeners and level of logging for a listener you need a reference to the listener that is going to be doing the tracing. Your call to create a new TraceSource object creates a trace source with the same name as the one used by the System.Net.Sockets classes, but it's not the same trace source object, so any changes do not have an effect on the actual TraceSource object that System.Net.Sockets is using. Because of this, you'll need to use the application configuration file to enable the trace. The tracing config settings lets you listen to messages from a trace source (in this case from Socket classes) but the TraceSource instance itself remains private and inaccessible directly/programmatically. Think of it this way – you don’t want to grant direct access to your trace source instance and let someone send messages under disguise but you do want to allow operations to configure what level of information you trace and where you trace etc…

    C# debugging question csharp

  • System.Net.Sockets - Tracing with TraceSource class
    W wurzel_cidermaker

    If you create a <[yourAppName].exe.config> file like the one below, you will see extra "socket" debug tracing information. However when I try to do this programmatically (below), I don't see any trace info. <<< TraceSource ts = new TraceSource("System.Net.Sockets", SourceLevels.Verbose); ConsoleTraceListener consoleListener = new ConsoleTraceListener(); consoleListener.Name = "console"; ts.Listeners.Add(consoleListener); >>> The question is why? Can it be done programmatically? Here's the config file that works...

    C# debugging question csharp
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups