Click here to Skip to main content
15,569,696 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Why I am getting a fllename or volume or label syntax error incorrect on reading file via continuous service installed in IIS 7.5?
I am running a windows service installed in server. I am fetching files from a folder and reading and moving the file from source folder to destination folder. But sometimes I am getting "Filename or volume or label Syntax Incorrect Error".There are other service also running at times. In local while running no such error seen.
My code is as follows:
C#
strmDirectPIF = new StreamReader(DirectPIFToBeDonePath);

                    while ((PIFRecord = strmDirectPIF.ReadLine()) != null)
                    {
                        words = PIFRecord.Split(',');
                        if (words[0] == "EDR")
                        {
Read the file content
}
   strmDirectPIF.Close();
                                                        MoveFile(DirectPIFToBeDonePath,DirectPIFDonePath);
Posted
Updated 15-May-14 22:57pm
v2

1 solution

Have you checked the actual filename? Maybe the syntax is incorrect... Try to log the filenames so you can check it out.

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900