Intermec Home

How to Buy | Partner Login


IMPORTANT!

Developer Support boards have been set to Read Only. As of January 31 2016 the legacy Intermec Developer Support boards will no longer be available. Please log on to the Honeywell Support Portal at that time to begin using the new Support forum.
THIS ACTION WILL NOT INCLUDE ANY VOCOLLECT BOARDS!
Showing results for 
Search instead for 
Do you mean 
Reply
VC Access
Posts: 1
Registered: ‎January 25 2012
0

Deleting files in SSConfigDir folder

Hi!

 

I'm developing a pogram that copies some files to the 'SmartSystems\SSConfigDir' and then waits for their respective output files (for example, if the file copied is 'wifi.xml', it will look for 'wifi.xml_out').

Before this, the program already checks for the 'SaveCfgFiles=1' value in the registry (HKLM\Software\Intermec\SSClient).

 

Before copying files, I need to ensure that the folder is empty, so I try to delete any file in there. C# code follows:

 

try
            {
                String[] files = Directory.GetFiles(@"\SmartSystems\SSConfigDir");
                foreach (String f in files)
                    Directory.Delete(f);
                return true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Deleting files", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
                return false;
            }

 

I'm getting a System.IO.IOException every time: "Access to the path '\SmartSystems\SSConfigDir\Phone.xml_ss' is denied"

 

Is deleting forbidden by any reason? If so, is there a way to clean all the files in the folder (maybe using another xml in SmartConfig to delete all files...)??

 

Thank you in advance

Super Contributor
Posts: 109
Registered: ‎March 3 2009

Re: Deleting files in SSConfigDir folder

[ Edited ]

Your trying to delete a file right?

 

Wouldn't you want to use File.Delete() instead of Directory.Delete()?

 

File.Delete Method