473,325 Members | 2,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

A question about using relative paths in my windows application

Hi everyone,

This is probably a pretty stupid question but does anyone know if its
possible to use relative addressing when it comes to accessing an image of
the file system?

In particular, I am making a simple application that needs to load a
treeview with icons. The icons are stored in a folder called icons under the
application's directory. (The folder exists in the same dir as the bin
folder and the debug folder)

The only way I can get the image to work is to put in the whole address.

Is it possible to use a relative address? Like just \icons or something? Is
it a good idea to do this?

I'm just trying to think ahead to what it would take to deploy this
application. (Not that I'm going to). I would need some sort of generic
address mechanism and of course Absolute Addressing is not at all generic.

Any advice would be greatfully recevied.

Simon
Nov 15 '05 #1
2 4513
Hi Simon,

Yes, you should use relative address.
However, you have to create full path string when needed.
Root path (where exe is located) is stored in Application.StartupPath.
So, to find icons, you'll use path (in C# there is double blackslash)
Application.StartupPath+\\icons

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com

"Simon Harvey" <sh856531@microsofts_free_email_service.com> wrote in message
news:uo**************@TK2MSFTNGP12.phx.gbl...
Hi everyone,

This is probably a pretty stupid question but does anyone know if its
possible to use relative addressing when it comes to accessing an image of
the file system?

In particular, I am making a simple application that needs to load a
treeview with icons. The icons are stored in a folder called icons under the application's directory. (The folder exists in the same dir as the bin
folder and the debug folder)

The only way I can get the image to work is to put in the whole address.

Is it possible to use a relative address? Like just \icons or something? Is it a good idea to do this?

I'm just trying to think ahead to what it would take to deploy this
application. (Not that I'm going to). I would need some sort of generic
address mechanism and of course Absolute Addressing is not at all generic.

Any advice would be greatfully recevied.

Simon

Nov 15 '05 #2
Thanks Miha!

Simon
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Doug | last post by:
If I were to write an include with a relative path like include("../conf/config.php"); What is the use? As far as I understand it, the path is relative to the first script that is called by...
0
by: Jason Moore | last post by:
I am trying to setup an asp.net web application without using a virtual directory, but when I do, the IDE forces me to use absolute paths so I cannot use root relative paths. Is there a way to...
2
by: Joe | last post by:
Hi, can someone tell me how to set up relativ paths in VS2003 C++ ? I have some source with a tree directory structure that segments include files in various directories: #include...
2
by: Alex | last post by:
Hi. I need some help on this. I have a user control (a header) in my root directory, and all my pages use that control. Then a created a folder (in my root directory) and put a new page inside it,...
3
by: Dave | last post by:
Hi, since I'm developing on XP and can only have on website, how can you refer to your root application (not web) in your paths? I read for server controls that "the ~/ prefix will be converted...
3
by: bobdydd | last post by:
Hi Everybody Access 2000, Outlook 2000 Windows XP I am running the code below to open Microsoft Outlook from a Command Button. It works fine until I tried it on a machine that has Office...
5
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. I have a virtual directory named Vehicles which serves a website. An ..aspx page in the Vehicles directory needs to display an image from a folder existing one folder above Vehicles. So I...
0
by: Stef Mientki | last post by:
hello, I'm running Python 2.5 and want my programs to run at least under Windows and Linux (preferable also Mac). So I guess I should always use relative paths. From most modules I can call a...
3
by: buzz2050 | last post by:
Hi all, I am using cURL for the first time. I need to login to a site and my cURL code to do the same is as follows: //curlScript.php <?php function getContent($url, $referer,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.