Skip to content

Class Network

Kristian Virtanen edited this page Oct 28, 2024 · 3 revisions

Description

The Network class provides methods to perform network operations, such as downloading files and retrieving web page contents. It also includes error handling via the LastError property, which stores the most recent error message if an operation fails.

Properties

Network.LastError

  • Description: Stores the last error message, if any operation fails, including a timestamp in yyyy-MM-dd HH:mm:ss format.
  • Example: "2024-10-16 14:30:00: Unable to download file: Network error."
  • Differences from orig. SB: New feature for SBOE.

Methods

Network.DownloadFile(fileName, url)

  • Description: Downloads a file from the specified URL and saves it to the provided file path.
  • Parameters:
    • fileName: The path where the downloaded file will be saved.
    • url: The URL of the file to download.
  • Returns: The path to the saved file as a string, or null if the download fails.

Network.GetWebPageContents(url)

  • Description: Retrieves the contents of a web page as a string.
  • Parameters:
    • url: The URL of the web page to retrieve.
  • Returns: The contents of the web page as a string, or null if the request fails.

Top

Clone this wiki locally