class DesktopEntry

Special set of functions for working with ini-like .desktop files.

static void addField(string filepath, string field, string value)

This function adds new field to ini-like .desktop file.

Parameters

filepath

path to .desktop file

field

field name

value

value for new field

static string getField(string filepath, string field)

This function returns value of specified field from .desktop file.

Parameters

filepath

path to .desktop file

field

field name

static void setField(string filepath, string field, string value)

This function sets new value for existent field from .desktop file.

Parameters

filepath

path to .desktop file

field

field name

value

new value of the field

static string getTitle(string pathToDesktopFile)

The function returns title from .desktop file (field "Name").

static string createNetworkLink(
    string networkPath,
    string destinationDir,
    string name = ""
)

Creates a .desktop file with the link to the network resource.

Parameters

networkPath

path to the network resource

destinationDir

directory for saving

name

final desktop-file name (if empty, the name is taken from the title of the HTML page or from network address)

Returns

path to created desktop file

static string getURL(string pathToDesktopFile)

Returns link to network resource from .desktop file (field "URL").