Question

I am writing this app in windows form c#. When user exit from this app , it asks for system reboot. While exiting it writes some XML file and saves the file in current directory(bin/debug)....On system restart my app restarts itself (by reading value from registry)and check if those file exist (if(File.Exists))or not..My problem is on system restart it doesn't check for file existence at all...and shows wrong output...But when I close it and restart it again it shows the right output..I really cant understand its problem...Can anybody please help me...??

Was it helpful?

Solution

The program needs to read the file from an absolute directory location and not a relative or current. Its context upon start may be different than when it was last run.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top