如何解决“找不到路径的一部分”错误。 [英] How to solve "Can not find part of path" error.

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

问题描述

我正在编写一个程序,它将文件读入数组,每次命中回车符或逗号时都会创建数组的新对象。然后,它根据这些对象创建文件或文件夹(用户确定他们想要的输出)。


如果我加载一个文件并选择创建文件夹,它就能完美运行。但是,如果我选择相同的文件并告诉它创建文件而不是文件夹我会收到此错误:

找不到路径的一部分''C:\ Users \ Dahlia \\ \\Desktop\Tester\test 15 \ first first is safe.txt"


如果我告诉它创建文件而不是文件夹,我选择的任何文件都会出现此错误。


如果有所不同,我正在使用VS C#Express 2010。我不知道如何让它停止发出错误,因为我不理解错误。


提前谢谢。

解决方案

你可以发布导致这个错误的代码,

我的意思是创建文件和文件夹的代码?


代码出现因此:

展开 | 选择 | Wrap | 行号


您没有告诉我们错误发生在哪一行,但我我猜它就在这里。

展开 < span class =codeDivider> | 选择 | Wrap | Line编号

I''m writing a program that reads a file into an array creating a new object of the array each time it hits a carriage return or a comma. It then creates either a file or folder based off of those objects (the user determines what output they want).

If I load in a file and choose to create folders it works perfectly. However if I select the same file and tell it to create files rather then folders I get this error:
"Could not find a part of the path ''C:\Users\Dahlia\Desktop\Tester\test 15\first line is safe.txt"

This error occurs for any file I choose if I tell it to create files rather then folders.

I''m using VS C# Express 2010 if that makes a difference. I don''t know how to make it stop giving that error because i don''t understand the error.

Thanks in advance.

解决方案

could you post the code which causes this error,
I mean the code that creates the files and folders?


The code appears as such:

Expand|Select|Wrap|Line Numbers


You didn''t tell us which line the error was occuring, but I would guess it''s here.

Expand|Select|Wrap|Line Numbers


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

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