urgent
-
hello i want to create a directory from windows services my code is as below but is doesnt seems to do the work how can i do this. protected override void OnStart(string[] args) { Thread mythread= new Thread(new ThreadStart(Run)); mythread.Start(); } private void Run(){ System.IO.DirectoryInfo dI= new DirectoryInfo(@"c:/mydir/mysubdir"); if(!dI.Exists) { dI.Create(); } }
-
hello i want to create a directory from windows services my code is as below but is doesnt seems to do the work how can i do this. protected override void OnStart(string[] args) { Thread mythread= new Thread(new ThreadStart(Run)); mythread.Start(); } private void Run(){ System.IO.DirectoryInfo dI= new DirectoryInfo(@"c:/mydir/mysubdir"); if(!dI.Exists) { dI.Create(); } }
First of all, please use a descriptive topic for your post next time, instead of "urgent". You'll likely get more replies if you stick with a descriptive topic. In order to help you diagnose your problem, can you tell us what isn't working? Have you setup a debug breakpoint in the code to see whether the directory already exists?
Tech, life, family, faith: Give me a visit. I'm currently blogging about: God-as-Judge, God-as-Forgiver The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
-
hello i want to create a directory from windows services my code is as below but is doesnt seems to do the work how can i do this. protected override void OnStart(string[] args) { Thread mythread= new Thread(new ThreadStart(Run)); mythread.Start(); } private void Run(){ System.IO.DirectoryInfo dI= new DirectoryInfo(@"c:/mydir/mysubdir"); if(!dI.Exists) { dI.Create(); } }