[1:2:4]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (5).zip: Filesize,11624
[1:2:4]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (3) (2) (2).zip: Filesize,0
[1:2:4]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (6).zip: Filesize,11624
[1:2:5]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (3) (2) (3).zip: Filesize,8164795
[1:2:5]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (3) (3).zip: Filesize,8164795
[1:2:8]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (7).zip: Filesize,8164795
[1:2:9]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (8).zip: Filesize,26625
[1:2:11]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (9).zip: Filesize,11624
[1:2:4]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (3) (2) (2).zip: Filesize,0
[1:2:4]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (6).zip: Filesize,11624
[1:2:5]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (3) (2) (3).zip: Filesize,8164795
[1:2:5]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (3) (3).zip: Filesize,8164795
[1:2:8]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (7).zip: Filesize,8164795
[1:2:9]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (8).zip: Filesize,26625
[1:2:11]:C:UsersAdministratorDesktopTELEGRAM.SECOND.STAGEUploads (9).zip: Filesize,11624
libary: using myoddweb.directorywatcher;
my File im watching gets downloaded automatically by Telegram, but its not catching tHe Filesize all the times, it sometimes displays 0.
Can someone help me to fix this problem? Im currently using this Code:
// create Watcher
var watcher = new Watcher();
watcher.Add(new Request(path_desktop + "\TELEGRAM.SECOND.STAGE", true));
watcher.Start();
watcher.OnAddedAsync += async (f, t) =>
{
FileInfo x = new FileInfo(f.FileSystemInfo.FullName);
long filesize = x.Length;
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine($"[{f.DateTimeUtc.Hour}:{f.DateTimeUtc.Minute}:{f.DateTimeUtc.Second}]:{f.FileSystemInfo.FullName}: Filesize,{filesize}");
};
Console.ReadKey();
i did try everything no chance
2
Answers
You are only looking at a single option for files.. Take a look at the link below.
https://learn.microsoft.com/en-us/dotnet/api/system.io.filesystemwatcher?view=net-7.0
There are more options such as created, changed, deleted, etc and even a Notification Filter. Hopefully these extra parts may help you, especially if you the OnChanged…