53 lines
984 B
C#
Raw Normal View History

2024-12-16 21:23:13 +00:00
// See https://aka.ms/new-console-template for more information
using Gtk;
using System;
using System.Net.Http;
using System.Threading.Tasks;
2024-12-17 11:10:58 +00:00
using System;
using System.Runtime.InteropServices;
namespace drnetapi {
2024-12-16 21:23:13 +00:00
partial class Program {
2024-12-17 11:10:58 +00:00
public static string transform(string tr){
return tr + tr;
}
2024-12-16 21:23:13 +00:00
static async Task Main(string[] args){
Application.Init();
var window = new Window("My TEst");
window.SetDefaultSize(320,240);
window.DeleteEvent += (o,e) => Application.Quit();
2024-12-17 11:10:58 +00:00
var bgtask = RunIt();
2024-12-16 21:23:13 +00:00
window.ShowAll();
2024-12-17 11:10:58 +00:00
2024-12-16 21:23:13 +00:00
Application.Run();
2024-12-17 11:10:58 +00:00
await bgtask;
2024-12-16 21:23:13 +00:00
}
2024-12-16 21:45:16 +00:00
static async Task RunIt()
{
2024-12-17 11:10:58 +00:00
for(int i = 0; i < 100; i++){
//Thread.Sleep(1000);
2024-12-16 21:45:16 +00:00
string result = await DrApi.get_rants("https://devrant.com/feed/recent").ConfigureAwait(false);
Console.WriteLine(result);
2024-12-17 11:10:58 +00:00
}
2024-12-16 21:45:16 +00:00
}
2024-12-17 11:10:58 +00:00
};
2024-12-16 21:23:13 +00:00
2024-12-17 11:10:58 +00:00
};