Click or drag to resize

HttpRequestEventArgsTryReadFile Method

Tries to read the specified file from the document folder of the HttpServer.

Namespace:  Sfs2X.WebSocketSharp.Server
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
public bool TryReadFile(
	string path,
	out byte[] contents
)

Parameters

path
Type: SystemString
A String that represents a virtual path to find the file from the document folder.
contents
Type: SystemByte

When this method returns, an array of Byte or if it fails.

That array receives the contents of the file.

Return Value

Type: Boolean
true if it succeeds to read; otherwise, false.
Exceptions
ExceptionCondition
ArgumentNullExceptionpath is .
ArgumentException

path is an empty string.

-or-

path contains "..".

See Also