chore: remove placeholder example source content from repository
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
|
||||
using Gtk;
|
||||
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
partial class Program {
|
||||
|
||||
|
||||
private static readonly HttpClient client = new HttpClient(){
|
||||
Timeout = TimeSpan.FromSeconds(10) // Set a timeout to avoid hanging
|
||||
};
|
||||
|
||||
public static Task<string> get(string url){
|
||||
try
|
||||
{
|
||||
Console.WriteLine("SUCCESS\n " + url);
|
||||
|
||||
HttpResponseMessage response = await client.GetAsync("https://google.nl");
|
||||
|
||||
Console.WriteLine("SUCCESS3\n " + url);
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string responseData = await response.Content.ReadAsStringAsync();
|
||||
Console.WriteLine(responseData);
|
||||
return responseData;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Error: " + response.StatusCode);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Exception occurred: " + ex.Message);
|
||||
}
|
||||
|
||||
return "zzz";
|
||||
}
|
||||
|
||||
|
||||
static async Task Main(string[] args){
|
||||
Application.Init();
|
||||
var window = new Window("My TEst");
|
||||
window.SetDefaultSize(320,240);
|
||||
window.DeleteEvent += (o,e) => Application.Quit();
|
||||
Console.WriteLine("DID TASK\n");
|
||||
Console.WriteLine(get("https://www.google.nl"));
|
||||
//Console.WriteLine(await DrApi.get_rants("https://www.google.nl"));
|
||||
Console.WriteLine("DID TASK2\n");
|
||||
|
||||
window.ShowAll();
|
||||
Application.Run();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user