Click here to Skip to main content
15,902,114 members
Home / Discussions / C#
   

C#

 
QuestionDateTime to excel date integer Pin
spin vector12-May-06 4:46
spin vector12-May-06 4:46 
AnswerRe: DateTime to excel date integer Pin
Guffa12-May-06 4:50
Guffa12-May-06 4:50 
GeneralRe: DateTime to excel date integer Pin
spin vector12-May-06 4:56
spin vector12-May-06 4:56 
QuestionControl Collection - Tabs Pin
JohnnyBoyWonder12-May-06 3:34
JohnnyBoyWonder12-May-06 3:34 
AnswerRe: Control Collection - Tabs Pin
NaNg1524112-May-06 3:48
NaNg1524112-May-06 3:48 
Questionlooking for good training material Pin
JonEngle12-May-06 3:06
JonEngle12-May-06 3:06 
AnswerRe: looking for good training material Pin
NaNg1524112-May-06 3:20
NaNg1524112-May-06 3:20 
QuestionWMI + Memory leak Pin
g00fyman12-May-06 3:00
g00fyman12-May-06 3:00 
hi all,

am fiddling with wmi and this code, when i watch it in task manager, continues to grow in size. once integrate i will not be polling this frequently but i still would like to avaoid a continually growing application.

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Management;

namespace WMIPrinter
{
  class Program
  {
    static void Main(string[] args)
    {
      Thread t = new Thread(new ThreadStart(Go));
      t.Start();
    }

    private static void Go()
    {      
      while (true)
      {
        Thread.Sleep(60000);

        try
        {
          ManagementObjectSearcher searcher =
              new ManagementObjectSearcher("root\\CIMV2",
              "SELECT DriverVersion FROM Win32_PrinterConfiguration WHERE Name=\"HP Color LaserJet 4550 PCL\"");

          foreach (ManagementObject queryObj in searcher.Get())
          {
            Console.WriteLine("DriverVersion: {0}", queryObj["DriverVersion"]);
          }

          searcher.Dispose();
        }
        catch (ManagementException e)
        {
          Console.WriteLine("### EXCEPTION: " + e.Message);
        }
      }
    }
  }
}


any ideas please?

kind regards,
g00fy
QuestionProblems with using controls Pin
martinz081512-May-06 2:49
martinz081512-May-06 2:49 
Questionbroswer compatibility problem Pin
Parvathivadde12-May-06 2:09
Parvathivadde12-May-06 2:09 
AnswerRe: broswer compatibility problem Pin
NaNg1524112-May-06 2:14
NaNg1524112-May-06 2:14 
GeneralRe: broswer compatibility problem Pin
Parvathivadde12-May-06 2:24
Parvathivadde12-May-06 2:24 
GeneralRe: broswer compatibility problem Pin
NaNg1524112-May-06 3:09
NaNg1524112-May-06 3:09 
GeneralRe: broswer compatibility problem Pin
Parvathivadde12-May-06 3:15
Parvathivadde12-May-06 3:15 
QuestionNeed help in explicit convertion of char[] to string Pin
Ashraj198212-May-06 2:05
Ashraj198212-May-06 2:05 
AnswerRe: Need help in explicit convertion of char[] to string Pin
NaNg1524112-May-06 2:14
NaNg1524112-May-06 2:14 
GeneralRe: Need help in explicit convertion of char[] to string Pin
Ashraj198212-May-06 2:21
Ashraj198212-May-06 2:21 
AnswerRe: Need help in explicit convertion of char[] to string Pin
lmoelleb12-May-06 2:33
lmoelleb12-May-06 2:33 
QuestionBrowserCompatability Pin
Parvathivadde12-May-06 2:02
Parvathivadde12-May-06 2:02 
Questiona question about notifyicon ? Pin
cmpeng3412-May-06 2:02
cmpeng3412-May-06 2:02 
AnswerRe: a question about notifyicon ? Pin
NaNg1524112-May-06 2:09
NaNg1524112-May-06 2:09 
GeneralMessage Closed Pin
12-May-06 2:29
cmpeng3412-May-06 2:29 
GeneralRe: a question about notifyicon ? Pin
NaNg1524112-May-06 3:14
NaNg1524112-May-06 3:14 
GeneralRe: a question about notifyicon ? Pin
engsrini12-May-06 3:30
engsrini12-May-06 3:30 
GeneralRe: a question about notifyicon ? Pin
NaNg1524112-May-06 3:32
NaNg1524112-May-06 3:32 

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.