DataStream.OpenUri Method

Returns a stream suitable from reading from a resource specified by a URI.

Definition

Namespace: Extreme.Data
Assembly: Extreme.Data (in Extreme.Data.dll) Version: 3.2.0
C#
public static Stream OpenUri(
	string uri,
	params string[] extensions
)

Parameters

uri  String
A URI that can refer to a file on the local file system, or a location on the web.
extensions  String[]
A list of extensions to try if the specified path cannot be found.

Return Value

Stream
A stream suitable for reading from the resource.

Exceptions

ArgumentException

uri is a zero-length string, contains only white space, or contains one or more invalid characters as defined by InvalidPathChars.

ArgumentNullException

uri is null.

PathTooLongException

The specified path, file name, or both exceed the system-defined maximum length.For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.

DirectoryNotFoundException

The specified path is invalid, (for example, it is on an unmapped drive).

UnauthorizedAccessException

uri specified a directory.

-or-

The caller does not have the required permission.

FileNotFoundException

The file specified in path was not found.

NotSupportedException

uri is in an invalid format.

IOException

An I/O error occurred while opening the file.

See Also