C# ? copyto RAM disk - 不支持RAM驱动器的FAT32 [英] C# ? copyto RAM disk - FAT32 of RAM drive is not supported

查看:121
本文介绍了C# ? copyto RAM disk - 不支持RAM驱动器的FAT32的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

FileInfo fi = new FileInfo(@C:\Canion.mkv);

fi.CopyTo(@E:\);



所以,如果E:\是RAM磁盘。例如Dataram公司,



我得到了:



DirectoryNotFoundException:找不到一部分路径'E:\'



为什么?



然后我尝试



fi.CopyTo(@ VE :\);



并得到:



不支持给定路径的格式



为什么不支持FAT32的RAM驱动器?



我尝试过:



不支持FAT32的RAM驱动器

FileInfo fi = new FileInfo(@"C:\Canion.mkv");
fi.CopyTo(@"E:\");

So, if E:\ is RAM disk. for example Dataram Co.,

I got:

DirectoryNotFoundException: Could not find a part of the path 'E:\'

Why?

then I try

fi.CopyTo(@"VE:\");

and got:

The given path's format is not supported

why FAT32 of RAM drive is not supported?

What I have tried:

FAT32 of RAM drive is not supported

推荐答案

如果查看文档: FileInfo.CopyTo方法(字符串)(System.IO) [ ^ ]非常清楚。 string参数是文件名,而不仅仅是目录。你必须指定文件名。

试试这个:

If you look at the documentation: FileInfo.CopyTo Method (String) (System.IO)[^] it's pretty clear. the string parameter is a file name, not just a directory. You must specify the file name.
Try this:
fi.CopyTo(Path.Combine(@"E:\", fi.Name));


这篇关于C# ? copyto RAM disk - 不支持RAM驱动器的FAT32的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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