Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
好吧,我想知道可以将最近下载的文件的文件名和路径返回到 Windows 临时文件夹的方法或任何 API。我试过Fileinfo了,但它不完全是我想要的。那么,有没有办法实现我想要的?
Fileinfo
编辑:我想我确实提到了临时文件夹,即c:\\Users\\aneal\\appdata\\Local\\Temp. 目的是在删除之前将流媒体视频等临时文件复制到另一个位置。
c:\\Users\\aneal\\appdata\\Local\\Temp
如果您想要最近下载的文件的文件名,则必须编写一些逻辑来捕获它。可以使用以下内容找到临时目录:
System.IO.Path.GetTempPath();
或者
System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache);