Click here to Skip to main content
15,890,690 members
Home / Discussions / C#
   

C#

 
AnswerRe: Getting a random entry from a Generic Dictionary Pin
Luc Pattyn5-Jan-07 7:22
sitebuilderLuc Pattyn5-Jan-07 7:22 
GeneralRe: Getting a random entry from a Generic Dictionary Pin
Mike Heffernan5-Jan-07 9:05
Mike Heffernan5-Jan-07 9:05 
QuestionHow to insert picture in RTB & hot to printing from Rich Text Box Pin
TrooperIronMan5-Jan-07 5:42
TrooperIronMan5-Jan-07 5:42 
AnswerRe: How to insert picture in RTB & hot to printing from Rich Text Box Pin
TrooperIronMan6-Jan-07 7:44
TrooperIronMan6-Jan-07 7:44 
GeneralRe: How to insert picture in RTB & hot to printing from Rich Text Box Pin
TrooperIronMan6-Jan-07 11:19
TrooperIronMan6-Jan-07 11:19 
QuestionConnect to running instance of C# application Pin
softplanner5-Jan-07 5:35
softplanner5-Jan-07 5:35 
AnswerRe: Connect to running instance of C# application Pin
Not Active5-Jan-07 6:03
mentorNot Active5-Jan-07 6:03 
QuestionWindows service to open folder Pin
milan5-Jan-07 5:29
milan5-Jan-07 5:29 
Hi all,
I have using FileSystemWatcher class so as to watch particular folder. If any new files get copied to it, windows explorer open the folder automatically. It works fine with console application but when it's been created as a windows service, it doesn't work. The code ---
public class JobClass
    {
        public void startJob()
        {
            FileSystemWatcher watcher = new FileSystemWatcher();
            watcher.Filter = "*.*";
            watcher.Path   = "c:\\DMSTemp";
            watcher.EnableRaisingEvents = true;
            watcher.Created +=new FileSystemEventHandler(watcher_Created);
            Console.ReadLine();
                      
        }
        void watcher_Created(object sender, FileSystemEventArgs e)
        {
            Process process = new Process();
            process.StartInfo.FileName = "explorer.exe";
            process.StartInfo.CreateNoWindow = true;
            process.StartInfo.Arguments = "c:\\DMSTemp";
            process.Start();
        }
        
    }


From the onStart() event of WindowsService, JobClass's startJob method is invoked.

protected override void OnStart(string[] args)
        {
            JobClass jobClass = new JobClass();
            jobClass.startJob();
            
        }



Any idea?

Thanks,
milan

satan

QuestionMDI Forms Pin
Civic065-Jan-07 4:44
Civic065-Jan-07 4:44 
AnswerRe: MDI Forms Pin
Ravi Bhavnani5-Jan-07 4:59
professionalRavi Bhavnani5-Jan-07 4:59 
QuestionC# Threading Pin
manustone5-Jan-07 4:44
manustone5-Jan-07 4:44 
AnswerRe: C# Threading Pin
Ravi Bhavnani5-Jan-07 4:57
professionalRavi Bhavnani5-Jan-07 4:57 
GeneralRe: C# Threading Pin
manustone5-Jan-07 11:00
manustone5-Jan-07 11:00 
QuestionEnumerate over an enumeration Pin
eggsovereasy5-Jan-07 4:29
eggsovereasy5-Jan-07 4:29 
AnswerRe: Enumerate over an enumeration Pin
Ravi Bhavnani5-Jan-07 4:32
professionalRavi Bhavnani5-Jan-07 4:32 
GeneralRe: Enumerate over an enumeration Pin
eggsovereasy5-Jan-07 4:37
eggsovereasy5-Jan-07 4:37 
QuestionPing in .NET 1.1 Pin
MartyExodus5-Jan-07 3:48
MartyExodus5-Jan-07 3:48 
AnswerRe: Ping in .NET 1.1 Pin
ednrgc5-Jan-07 4:01
ednrgc5-Jan-07 4:01 
AnswerRe: Ping in .NET 1.1 Pin
PIEBALDconsult5-Jan-07 4:03
mvePIEBALDconsult5-Jan-07 4:03 
AnswerRe: Ping in .NET 1.1 Pin
Dan Neely5-Jan-07 4:07
Dan Neely5-Jan-07 4:07 
GeneralRe: Ping in .NET 1.1 Pin
MartyExodus5-Jan-07 4:41
MartyExodus5-Jan-07 4:41 
GeneralRe: Ping in .NET 1.1 Pin
led mike5-Jan-07 5:19
led mike5-Jan-07 5:19 
GeneralRe: Ping in .NET 1.1 Pin
MartyExodus5-Jan-07 7:20
MartyExodus5-Jan-07 7:20 
GeneralRe: Ping in .NET 1.1 Pin
led mike5-Jan-07 9:31
led mike5-Jan-07 9:31 
GeneralRe: Ping in .NET 1.1 Pin
PIEBALDconsult5-Jan-07 7:33
mvePIEBALDconsult5-Jan-07 7:33 

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.