-
Notifications
You must be signed in to change notification settings - Fork 0
Class Network
Kristian Virtanen edited this page Oct 14, 2024
·
3 revisions
Provides methods to perform network operations, such as downloading files and retrieving web page contents.
Network.DownloadFile(fileName, url)- Downloads a file from the specified URL and saves it to the provided file path.
- Returns the path to the saved file, or an empty string if the download fails
Network.GetWebPageContents(url)- Retrieves the contents of a web page as a string.
- Returns the contents of the web page as a string, or an empty string if the request fails.
Console.WriteLine(Network.GetWebPageContents("http://example.com"))
Network.DownloadFile("temp.svg", "https://huggingface.co/front/assets/huggingface_logo-noborder.svg")namespace SmallBasicOpenEditionDll
{
class Program2
{
static void Main(string[] args)
{
string content = Network.GetWebPageContents("http://example.com");
Console.WriteLine(content);
string fileName = "temp.txt";
Network.DownloadFile(fileName, "https://huggingface.co/front/assets/huggingface_logo-noborder.svg");
}
}
}