Link to home
Start Free TrialLog in
Avatar of pradeepy
pradeepy

asked on

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.
Avatar of fcnatra
fcnatra
Flag of Spain image

Try using this properties:

// Init app dir
Application.StartupPath

// User dir
Application.UserAppDataPath

Avatar of Timbo87
Timbo87

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."
Avatar of pradeepy

ASKER

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

Thanks.
Do you mean you need to search the hard drive for that file?
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.
ASKER CERTIFIED SOLUTION
Avatar of Timbo87
Timbo87

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok Timbo87 ,
        can you give that piece of code ahich searches for the file recursively.

Thank You.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial