Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Server.Mappath equivalent in windows application

Posted on 2004-10-25
10
Medium Priority
?
5,906 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

636 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