为什么我通过IIS 7.5中安装的连续服务读取文件时出现错误名称或卷或标签语法错误? [英] Why I am getting a fllename or volume or label syntax error incorrect on reading file via continuous service installed in IIS 7.5?

查看:91
本文介绍了为什么我通过IIS 7.5中安装的连续服务读取文件时出现错误名称或卷或标签语法错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我通过IIS 7.5中安装的连续服务读取文件时出现错误名称或卷或标签语法错误?

我正在运行服务器中安装的Windows服务。我从文件夹中获取文件并读取文件并将文件从源文件夹移动到目标文件夹。但有时我得到文件名或卷或标签语法错误错误。还有其他服务有时也在运行。在本地运行时没有看到这样的错误。

我的代码如下:

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:

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);

推荐答案

你检查了实际的文件名吗?也许语法不正确...尝试记录文件名,以便您可以检查它。



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

Good luck!


这篇关于为什么我通过IIS 7.5中安装的连续服务读取文件时出现错误名称或卷或标签语法错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆