Table of Contents

Method PrepareFileUrl

Namespace
Alternet.UI
Assembly
Alternet.UI.Interfaces.dll

PrepareFileUrl(string)

Prepends filename with "file" url protocol prefix.

public static string PrepareFileUrl(string filename)

Parameters

filename string

Path to the file.

Returns

string

string containing filename with "file" url protocol prefix.

Remarks

Under Windows file path starts with drive letter, so we need to add additional "/" separator between protocol and file path. This functions checks for OS and adds "file" url protocol correctly. Also spaces are replaced with %20, other non url chars are replaced with corresponding html codes.