次の方法で共有


IServer::MapPath

The IServer::MapPath method maps the specified relative or virtual path to the corresponding physical directory on the server. For more information, see the Server.MapPath method of the Server object.

HRESULT MapPath(
      BSTR bstrLogicalPath,
      BSTR* pbstrPhysicalPath
);

Parameters

  • bstrLogicalPath
    [in] A binary string that contains the relative or virtual path.

  • pbstrPhysicalPath
    [retval] [out] Points to a binary string that receives the physical path.

Remarks

This method does not check whether the path it returns is valid or exists on the server. Because the IServer::MapPath method maps a path regardless of whether the specified directories currently exist, you can use it to map a path to a physical directory structure, and then pass that path to a component that creates the specified directory or file on the server.

The IServer::MapPath method returns the ASP 0173 error, "Invalid Path Character", if the Path parameter contains any of the following characters:

  • Asterisk (*)

  • Question mark (?)

  • Angle brackets (< or >)

  • Comma (,)

  • Colon or semi-colon (: or ;)

  • Single-quote or double-quote (' or ")

  • Right square bracket (])

  • Double slashes (// or \\)

Requirements

Client: Requires Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.

Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.

Product: IIS

See Also