There are no cases when hard-coding of any file path can be useful. The file paths should always be calculated during runtime, based on system configuration fetched from API, configuration files, user input, etc. In the case of a Web application, it is especially important: it is executed in a sandboxed environment which does not allow access to any file system objects which are not under the root directory reserved for the site.
Therefore, the hard-coded path you used may or may not be legitimate. Worse, such code is not supportable: should you change your hosting or any hosting environment detail, it will break your application. Moreover, if you use some shared hosting service, as most do, you won't have any control over the root directory of your site. The hosting provider may change it at any moment.
So, this is what you should fix. You can use
Server.MapPath
:
http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath.aspx[
^].
—SA