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.
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.
You can use Environment.CurrentDirecto ry
"Gets and sets the fully qualified path of the current directory; that is, the directory from which this process starts."
"Gets and sets the fully qualified path of the current directory; that is, the directory from which this process starts."
ASKER
Hi Timbo87,
my file can be located anywhere in the harddrive. How do i get that
specific location.
Thanks.
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?
ASKER
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok Timbo87 ,
can you give that piece of code ahich searches for the file recursively.
Thank You.
can you give that piece of code ahich searches for the file recursively.
Thank You.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
// Init app dir
Application.StartupPath
// User dir
Application.UserAppDataPat