如何避免iis服务器中的文件名,目录名或卷标语法不正确? [英] How to avoid The filename, directory name, or volume label syntax is incorrect in iis server?

查看:289
本文介绍了如何避免iis服务器中的文件名,目录名或卷标语法不正确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何避免IIS服务器中的文件名,目录名或卷标语法不正确。我们正在使用VS 2005(C#2.0,ASP.NET,iis 7.5)我们在web.config中创建了一些共享文件夹和路径,从中读取文件并使用app.config设置了windows服务(Read文件)为相同的。但是上面的错误来了。



在web.config中,ftp设置如下:

How to avoid The filename, directory name, or volume label syntax is incorrect in IIS server . We are using VS 2005( C#2.0, ASP.NET,iis 7.5) We have created some shared folders and paths of them set in web.config from which to read the files and there are windows service set with app.config (Read Files) for the same. But the above error comes.

In web.config ftp settings are as follows:

<add key="ftp_TO_AFS" value="ftp://nestit-267/RonyFTP/ToAFS/" />
   <add key="ftp_TO_AFS_USERID" value="" />
   <add key="ftp_TO_AFS_PWD" value="" />





Ftp从To_AFS fs读取文件如下:

FTP objFromAfsFtp = new FTP();

objFromAfsFtp.Uri = ConfigurationManager.AppSettings [ftp_FROM_AFS]。ToString()。Trim();

objFromAfsFtp.UserName = ConfigurationManager.AppSettings [ftp_FROM_AFS_USERID]。ToString()。Trim();

objFromAfsFtp.Password = ConfigurationManager.AppSettings [ftp_FROM_AFS_PWD]。ToString()。Trim();



string errorStr = string.Empty;

//从FROM_AFS获取所有文件Ftp

string [] getFiles = objFromAfsFtp.GetFileList(ref errorStr);



大部分都没有阅读问题。在IIS FTP中运行服务时,错误日志会将错误信息写入错误日志。



Ftp reads the files from To_AFS fs follows:
FTP objFromAfsFtp = new FTP();
objFromAfsFtp.Uri = ConfigurationManager.AppSettings["ftp_FROM_AFS"].ToString().Trim();
objFromAfsFtp.UserName = ConfigurationManager.AppSettings["ftp_FROM_AFS_USERID"].ToString().Trim();
objFromAfsFtp.Password = ConfigurationManager.AppSettings["ftp_FROM_AFS_PWD"].ToString().Trim();

string errorStr = string.Empty;
//Get All files from FROM_AFS Ftp
string[] getFiles = objFromAfsFtp.GetFileList(ref errorStr);

No issue in reading is seen mostly. Some times above error msg is written into the error log on running a service in IIS FTP.

推荐答案

在web.config中使用此行(在system.web中) :

Using this line in your web.config (inside system.web):
<customerrors mode="On" />





问候。



Regards.


这篇关于如何避免iis服务器中的文件名,目录名或卷标语法不正确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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