Converting absolute path to relative

dotnet framework

    Next

  • 1. winxp pro+sp2 ASP.net global.aspx strange problem
    Hi, on my machine (winxp Pro+sp2) with framework 1.1 the aspnet runs session_start before application_start my web application that assumes application_start will run before breaks! what can you tell??? TIA, z.
  • 2. Set culture for a DLL (class library) referenced from web application
    I am developing a DLL (class library) for a web application of mine. In the web.config of the web application I have set: culture="en-GB" uiCulture="en" in order that the date format will be dd/mm/yyyy. I also changed the regional settings to that date format. When I am using the Now() function in the DLL I get the date format in mm/dd/yyyy instead. Why the date format in the DLL is different? Shouldn't it take the culture settings from the web application he is referenced from? How can I control the date format of the DLL (class library)? Thanks for your time XXXX@XXXXX.COM
  • 3. MIDI in C#
    .NET/C# doesn't seem to have much support for MIDI interface and music playback in general. Are there any good references on it?
  • 4. .dll, other install programs
    I'm trying to use 3 .net C++ built dlls in a National Instruments LabWindows application and include them in the LabWindows (5.5) install. I've installed the .net 1.1 framework on the target computer, but when I run my application after the install, I get a "application did not initialize properly (0xc0000005)" error. This is occuring on a Windows XP machine, sp2. My application runs fine on the Windows 2000 machines I've installed it on and the older versions of my app that use a Visual C++ 6.0 built dll run fine on the XP machine. What is going on? Do I need to do something special in the registry or something for the .net built dlls under Windows XP? Thanks! I've also posted this under .net-general discussion since I didn't know really which was more appropriate...sorry about the double-posting

Converting absolute path to relative

Postby Dmitry Shaporenkov » Sat, 27 Sep 2003 01:55:49 GMT

Hi,

assume I have two paths referring to files on the same 
logical volume, like "C:\Home\Dir1\file1.txt" 
and "C:\Home\Dir2\file2.txt". How can I convert the 
second absolute path to a relative path based on the 
first one, like "..\Dir2\file2.txt"? I'm looking into the 
System.IO.Path class but can't find an answer...

Thanks in advance,
Dmitry

Similar Threads:

1.How to chage Absolute url to relative url ,and relative url to absolute url

How to chage Absolute url to relative url ,and relative 
url to absolute url

2.why relative hint path but absolute reference path

I have a vs.net 2002 solution that contains a number of projects
All projects are created in folders under the solution folder.
The idea here is that this entire solution should be 'moveable' ie. copied
to and useable from a new directory or computer.
And it almost is.

One project makes reference to an existing .net dll that also exists in a
folder under the solution folder.
The project file shows a relative hint path to the dll ie
"..\..\dllFolder\my.dll"
If I move the solution to a new folder and the open solution from the new
location, the dll can no longer be found.  if i restore the original
solution folder, the dll is once again found.  so obviously, although the
project file includes a relative hint path, vs.net is in fact looking for
the dll at an absolute location.  This is causing headaches as this solution
cannot be 'passed around'  without re-adding the reference to this dll.

is there some setting somewhere to get the relative path used ?
there does not seem to be any problem using relative project references - is
there some trick using a dummy project to get this to work ?

gerry



3.Get machine name path from relative or absolute path

Hello, is it possible in C#.Net to get a path to a file in the form
"\\Spain\Madrid\readme.txt" from a relative path i.e "readme.txt" or
from a absolute path in the following form "C:\Madrid\readme.txt" where
"Spain" is the name of the machine that the file is on? Thanks in
advance.

4.absolute path to relative path conversion

5.why relative hint path but absolute reference path

I have a vs.net 2002 solution that contains a number of projects
All projects are created in folders under the solution folder.
The idea here is that this entire solution should be 'moveable' ie. copied
to and useable from a new directory or computer.
And it almost is.

One project makes reference to an existing .net dll that also exists in a
folder under the solution folder.
The project file shows a relative hint path to the dll ie
"..\..\dllFolder\my.dll"
If I move the solution to a new folder and the open solution from the new
location, the dll can no longer be found.  if i restore the original
solution folder, the dll is once again found.  so obviously, although the
project file includes a relative hint path, vs.net is in fact looking for
the dll at an absolute location.  This is causing headaches as this solution
cannot be 'passed around'  without re-adding the reference to this dll.

is there some setting somewhere to get the relative path used ?
there does not seem to be any problem using relative project references - is
there some trick using a dummy project to get this to work ?

gerry






6. Absolute or Relative path?

7. Relative & absolute path question (JavaScript, mostly)

8. User controls --> Relative/Absolute Paths



Return to dotnet framework

 

Who is online

Users browsing this forum: No registered users and 78 guest