[Answering after clarifications in reply to my comments to the questions:]
This path ("D:\") can be illegal on Windows 7. You can edit permissions for this directory, but it cannot make your code valid. If you execute it on some computer, how can you know that "D:" even exists? (On one of my computers, even "C:" does not exist; it's not a must.)
Generally, there are no cases where hard-coded file path can be useful. In all cases, it should be calculated during run time out of user-supplied data, data from configuration, assembly location, "special folders", per user or for "all users", so you can use
System.Environment.GetFolderPath(Environment.SpecialFolder)
, please see:
http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx[
^].
—SA