How to access a folder both by windows and web setup--ASP.NET & VB.NET


I have a windows application, which is installed in path say, C:\Program files\companyFolder\Applicationname

Similarly i have a web application, which when installed creates a virtual directory by any name specified by user.

I have a folder called 'inc' in the web application[virtual directory] created in IIS.

Thro the windows application i need to save some files[txt,doc..] in the same 'inc' folder.  

For saving the files, i need to identify the path where the inc folder is present. [1-server name,2-virtual dir name,3- the folder 'inc']

How do i retrieve the path[generalised way of identifying the path which will be coded in the windows application]?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The only way i can think of - is to add a App.config file and force the user (on installing the application) to specify the web application address and save it there.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rgvnAuthor Commented:
Reply to shai
Can u be even more detail on what u explain.

I think ur solution will be apt.
Well, you cannot go around 'looking' for a file in different computers - that will take forever - not to mention the security issues.

What you can do - is add a configuration variable to the application, in that configuration variable - save the complete path to the target file on the web app.

i suggested using a app.config file - but you can also use registry or simple text file in the folder the win app is installed in.

After you have that configuration value - you simply load it into your win app - and access directly to that file (without looking for it)

then you can replace it with a newer version, or whatever

Hope I help,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.