[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Server.Mappath equivalent in windows application

Posted on 2004-10-25
10
Medium Priority
?
6,199 Views
Last Modified: 2008-01-09
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.
0
Comment
Question by:pradeepy
8 Comments
 
LVL 4

Expert Comment

by:fcnatra
ID: 12402739
Try using this properties:

// Init app dir
Application.StartupPath

// User dir
Application.UserAppDataPath

0
 
LVL 15

Expert Comment

by:Timbo87
ID: 12404342
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
 

Author Comment

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

Thanks.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 15

Expert Comment

by:Timbo87
ID: 12404603
Do you mean you need to search the hard drive for that file?
0
 

Author Comment

by:pradeepy
ID: 12405087
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
 
LVL 15

Accepted Solution

by:
Timbo87 earned 500 total points
ID: 12405124
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
 

Author Comment

by:pradeepy
ID: 12405151
Ok Timbo87 ,
        can you give that piece of code ahich searches for the file recursively.

Thank You.
0
 
LVL 6

Assisted Solution

by:etmendz
etmendz earned 500 total points
ID: 12408297
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question