Hard Coded Paths in a .NET Program

Posted by maya on Stack Overflow See other posts from Stack Overflow or by maya
Published on 2010-04-09T05:29:34Z Indexed on 2010/04/09 5:53 UTC
Read the original article Hit count: 238

Filed under:
|

I am developing an application in C#. I have a folder called myfolder it contains a file called mypoints.bmp. The folder myfolder is in my project folder it is in D drive. The path is D:\Myproject\myfolder\mypoints.bmp.

Now, in my program, whereever I need mypoints.bmp I have hardcoded the whole path. When my project is copied in to a different system under C drive, I am not able to run my project because of the hardcoded path. How can I give the path so that there will not be any problem even if it is loaded in to a different system under a different drive.

© Stack Overflow or respective owner

Related posts about c#

Related posts about path