In any kind of application, there are no situations where any kind hard-coded paths could be useful. In all cases, the path should be calculated based on some user-supplied or configuration data or system environment, such as executable path, "special folders" associated per user accounts or dedicated for all users, and so on. Think about it: nothing guarantees that your next host system will even have "D:" drive. One of my desktop systems does not even have "C:". Using such kind of wanna-be-world-constants is a bad idea in general.
As to the Web applications, they are are more limiting: the application process is executed in a sandboxed environment, so your application won't have access to the file system objects local application may have. And this is a good safety feature. You can only use the part of the file system under the root directory associated with your Web site.
Normally, when a path name in your file system is required for your functionality, you should resolve URIs into local file system path on your server host and use this path. This is done using
System.Web.HttpServerUtility.MapPath
:
http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath.aspx[
^].
—SA