I'm using VLC to open video files in C# form application. In my code as you see below "File.Exists" always returns false, although the file exists in the given path. But, as seen in the commanded line, when I give the path manually the file gets opened. There's no problem in string.Format processing, I have checked it in debug mode many time, I get the right path from string.Format but still File.exists returns false.
1) Code
fileName = string.Format(@"\\192.168.12.25\secRecords\{6}\{7}\{0:00}{1:00}{2:00}\CAM{5}_{0:00}{1:00}{2:00}_{3:00}{4:00}.mp4", (dateTimePicker1.Value.Year % 100),
(dateTimePicker1.Value.Month),
dateTimePicker1.Value.Day,
dateTimePicker1.Value.Hour,
(dateTimePicker1.Value.Minute / 15) * 15, myStr[1], splittedIp[2], splittedIp[3]);
//fileName = @"\\192.168.12.25\secRecords\3\4\140617\CAM1_140617_1300.mp4";
if (File.Exists(fileName))
{
id = axVLCPlugin21.playlist.add(fileName);
trackBar1.Value = 0;
}
else
{
id = -1;
MessageBox.Show("File not found!");
}
fileName value in debug mode:
"\\\\192.168.12.25\\secRecords\\3\\4\\140617\\CAM1_140617_1300.mp4"