0

I have a program that, after downloading some files, is moving them around the C drive. When I call file.move though, I get the following exceptions:

A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll

Additional information: Exception has been thrown by the target of an invocation.

If there is a handler for this exception, the program may be safely continued.

I know that this can happen when you don't actually have the directory but I do. It actually DOES move the files correctly, it just throws up an error. I can't find any information on this? Should I just try and catch this fake error or should I figure out what's going on? Thanks!

4

2 回答 2

1

File.Move 不会抛出那种类型的异常。或者至少这就是 MSDN 上的例外列表所说的http://msdn.microsoft.com/en-us/library/system.io.file.move.aspx

所以这可能是由其他原因引起的,请检查内部异常并进一步调查。

于 2013-02-11T07:59:38.777 回答
0

有关此异常,请参阅 InnerException,您将知道原因。

于 2013-02-11T07:58:06.990 回答