Tuesday, 6 August 2013

Windows Form Getting the Filepath when the application is installed in the system

Windows Form Getting the Filepath when the application is installed in the
system

I have a Windows form Application which has error log file. i have kept
the error log file in the solution path and refer to the path in the code
as shown below
File.AppendText(@"../../ErrorLog.txt")
The code works fine when i run the code in the debug mode in any system.
But when i publish the code,take the .exe file and install the application
in my system,the application could not the find the error log file.when i
go to the installed path the error log file is named as
ErrorLog.txt.deploy file.
so how i should reference this path in my code so that it will work when
installed in any system?? Please advice me as i am new to Windows form
application

No comments:

Post a Comment