Click here to Skip to main content
15,922,894 members
Home / Discussions / C#
   

C#

 
GeneralRe: Preventing Form Focus Pin
Luc Pattyn5-Jan-07 12:50
sitebuilderLuc Pattyn5-Jan-07 12:50 
GeneralRe: Preventing Form Focus Pin
kmuthuk10-Jan-07 3:25
kmuthuk10-Jan-07 3:25 
QuestionChar problem Pin
CodeItWell5-Jan-07 7:09
CodeItWell5-Jan-07 7:09 
AnswerRe: Char problem Pin
Ravi Bhavnani5-Jan-07 7:17
professionalRavi Bhavnani5-Jan-07 7:17 
GeneralRe: Char problem Pin
CodeItWell5-Jan-07 9:19
CodeItWell5-Jan-07 9:19 
GeneralRe: Char problem Pin
Ravi Bhavnani5-Jan-07 9:31
professionalRavi Bhavnani5-Jan-07 9:31 
GeneralRe: Char problem [modified] Pin
CodeItWell5-Jan-07 10:29
CodeItWell5-Jan-07 10:29 
GeneralRe: Char problem Pin
Ravi Bhavnani5-Jan-07 11:18
professionalRavi Bhavnani5-Jan-07 11:18 
QuestionC#.NET Email Pin
TRK@UK5-Jan-07 6:26
TRK@UK5-Jan-07 6:26 
AnswerRe: C#.NET Email Pin
Ravi Bhavnani5-Jan-07 6:36
professionalRavi Bhavnani5-Jan-07 6:36 
AnswerRe: C#.NET Email Pin
Guffa5-Jan-07 8:03
Guffa5-Jan-07 8:03 
GeneralRe: C#.NET Email Pin
Dan Neely5-Jan-07 8:26
Dan Neely5-Jan-07 8:26 
GeneralRe: C#.NET Email Pin
Guffa6-Jan-07 10:09
Guffa6-Jan-07 10:09 
QuestionGetting a random entry from a Generic Dictionary [modified] Pin
Mike Heffernan5-Jan-07 5:58
Mike Heffernan5-Jan-07 5:58 
AnswerRe: Getting a random entry from a Generic Dictionary Pin
Ravi Bhavnani5-Jan-07 6:41
professionalRavi Bhavnani5-Jan-07 6:41 
GeneralRe: Getting a random entry from a Generic Dictionary Pin
Mike Heffernan5-Jan-07 9:03
Mike Heffernan5-Jan-07 9:03 
GeneralRe: Getting a random entry from a Generic Dictionary Pin
Ravi Bhavnani5-Jan-07 9:28
professionalRavi Bhavnani5-Jan-07 9:28 
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

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.