Server.Mappath equivalent in windows application

Hi,
  iam using windows application. I have file named myfile.txt which can be located anywhere in my harddisk. I want to know whether there is anything equivalent in windows application for Server.Mappath to map to my file virtually.

Any furthur comments and suggestions are welcome.

Thanks in advance.
pradeepyAsked:
Who is Participating?
 
Timbo87Commented:
No, you have to recursively search the hard drive for the file, which is taxing on the computer if you need to do it often.
0
 
fcnatraSoftware...Commented:
Try using this properties:

// Init app dir
Application.StartupPath

// User dir
Application.UserAppDataPath

0
 
Timbo87Commented:
You can use Environment.CurrentDirectory

"Gets and sets the fully qualified path of the current directory; that is, the directory from which this process starts."
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
pradeepyAuthor Commented:
Hi Timbo87,
             my file can be located anywhere in the harddrive. How do i get that
             specific location.

Thanks.
0
 
Timbo87Commented:
Do you mean you need to search the hard drive for that file?
0
 
pradeepyAuthor Commented:
Yes,
    is there a single command in console or windows application that retrives the full path of a file by specifying just the file name.

Thank you.
0
 
pradeepyAuthor Commented:
Ok Timbo87 ,
        can you give that piece of code ahich searches for the file recursively.

Thank You.
0
 
etmendzCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.