I am making a monitoring application that runs with Windows (Reg key added to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
to make my app run on Windows Start).
Here's the behavior of my application :
- It logs some informations
- It takes a screenshot
- Upload everything to mysql
- Wait 10 seconds
- Does everything again
When I compile my application in VisualStudio2015, everything works fine.
When I decide to add the autorstart key in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
, on Windows start, the application "seems" to freeze just before "Upload everything to mysql", here's the code just before "Upload everything to mysql" :
if (File.Exists(Directory.GetCurrentDirectory() + @"\screenshots\ScreenCapture.jpeg")) {
Is there anything denying my application from using "File.Exists" if the application is started by the registry (Windows) ?
Does my application has the same permissions ?
I have been struggling for 2 days on it and I would really appreciate some help.
Thanks.