How to convert a physical path into a virtual path

Updated on technology 2024-02-09
3 answers
  1. Anonymous users2024-02-05

    Convert the local path to a URL-relative path.

    private string urlconvertor(string imagesurl1)

    string tmprootdir = Get the root directory of the program.

    string imagesurl2 = , "");Convert to a relative path.

    imagesurl2 = "\", @"/");

    return imagesurl2;

    The relative path is converted to the server's local physical path.

    private string urlconvertorlocal(string imagesurl1)

    string tmprootdir = Get the root directory of the program.

    string imagesurl2 = tmprootdir + "/", @"\");Convert to an absolute path.

    return imagesurl2;

  2. Anonymous users2024-02-04

    The physical path is the absolute path, and the virtual path is the relative path. The absolute path is the absolute location of the specified file.

    As we all know, when we usually use the computer, we must know the location of the file to find the file we need, and the way to represent the location of the file is the path, for example, as long as we see this path: c: website img we know that the file is in the img subdirectory under the website directory of the c drive.

    In this way, the path to the location of the complete description file is the absolute path. We don't need to know anything else to figure out the location of a file based on the absolute path.

    The so-called relative path, as the name suggests, is the relative position of oneself and the target. Regardless of whether these files are placed in **, as long as their relative relationship does not change, there is no mistake.

  3. Anonymous users2024-02-03

    Convert the local path to a URL-relative path.

    private string urlconvertor(string imagesurl1)

    string tmprootdir = Get the root directory of the program.

    string imagesurl2 = , "");Convert to a relative path.

    imagesurl2 = "\", @"/");

    return imagesurl2;

    The relative path is converted to the server's local physical path.

    private string urlconvertorlocal(string imagesurl1)

    string tmprootdir = Get the root directory of the program.

    string imagesurl2 = tmprootdir + "/", @"\");Convert to an absolute path.

    return imagesurl2;

Related questions
13 answers2024-02-09

You save the path in an XML and read it out the next time you start it.

10 answers2024-02-09

I think it's time to buy a VB book. Break the bank!

16 answers2024-02-09

There are roughly six levels of learning physics, that is, first to understand, then to remember, to practice, to become proficient, to practice to make perfect, to innovate, from the initial goal of basic knowledge, and finally to the highest level of learning physics. >>>More

7 answers2024-02-09

1. First plug the hard disk into the computer and back up the data of the hard disk to the computer. >>>More

12 answers2024-02-09

Don't care about the times.

Virtual memory: 1. Right-click [My Computer] [Properties] [Advanced] tab, 2. Click [Settings] in the [Performance] column to continue clicking the [Advanced] tab, 3. Click [Change] in the [Virtual Memory] column to pop up the [Virtual Memory] dialog box, and you can set it. >>>More