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...??

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top