错误:找不到路径的一部分 [英] Error:Could not find a part of the path

查看:237
本文介绍了错误:找不到路径的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。


我有一个带有C#的ASP.Net表单,允许用户浏览到一个文件,然后将文件详细信息添加到列表框中;我使用列表框来保存多个文件的详细信息以启用批处理。

对于每个文件,我将其复制到名为C:\ uploads的文件夹中,文件是从那里处理。


对于我正在使用的复制命令:


File.Copy(listFileName.Text,importFolder);


我在这里收到一条消息:


无法找到路径'C:\ Uploads \'的一部分。


任何想法如何通过这个,因为我已尝试过网上的一些想法,但到目前为止还没有适用?


谢谢。


马克:)

Hi there.

I have an ASP.Net form with C# which allows a user to browse to a file and then add the file details to a listbox; I am using a listbox to hold the details for multiple files to enable batch processing.

For each file, I then copy it to a folder called C:\uploads and the file is processed from there.

For the copy command I am using:

File.Copy(listFileName.Text, importFolder);

and it is here that I receive a message:

Could not find a part of the path ''C:\Uploads\''.

Any ideas how to get passed this please, as I have tried a few ideas from the web but none have been applicable so far?

Thank you.

Mark :)

推荐答案

这对我没有任何意义....


你说你在使用ASP.NET吗?如何在不上传文件的情况下获取任何文件详细信息?除非您从正在浏览的同一台计算机上提供应用程序,否则您无法浏览用户的文件系统。


请说明你在做什么。
This doesn''t make any sense to me....

You say you''re using ASP.NET? How are you getting any file details without uploading the file? Unless you are serving the app from the same machine that you are browsing from, you shouldn''t be able to browse the user''s file system.

Please clarify what you''re doing.


这些文件是在客户端计算机上,而不是在服务器计算机上?

所以当服务器执行File.Copy()的SERVER代码时,它找不到这些文件?
The files are on the Clients computer, not on the server computer right?
So when the server executes the SERVER code of File.Copy(), it cannot find these files?





要解决您遇到的错误,您可以执行以下操作:


1>您应该将文件路径指定为C:\\upload \\

2>你应该指定@ chracter来给出特殊字符。

例如FilePath = @(c:\upload \)
Hi,

To solve the error you are getting , you can do the following things:

1> You should give the filepath as C:\\upload\\
2> You should specify @ chracter for giving special characters.
e.g FilePath = @(c:\upload\)


这篇关于错误:找不到路径的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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