I am developing an Windows Forms Application in .NET 4.0 on Windows 8 RTM (UAC disabled) with Visual Studio 2012. My current problem is that when i download an file with WebClient and try to access it after finishing download, File.Exists shows false. If i open Windows Explorer the file exists and has more than 10MB. For example it is an video file and if i try to convert it via ffmpeg, ffmpeg shows me that it can not find the file C:\.... but if i copy that path and paste it into explorer, it opens the video. What goes wrong ? "Run as Administrator" does not help. Here is the code.
String video = Path.Combine(Environment.CurrentDirectory, "tempVideo.mp4");
WebClient downloader = new WebClient();
downloader.DownloadFile(new Uri("http://someurl/somevideo.mp4"), video); //download is successfull
FileInfo dlVideo = new FileInfo(video);
if(dlVideo.Exists) //always false, File.Exists(video) also false
{
//Some other actions on file
}