rallez
rallez
CC#
Created by rallez on 2/26/2024 in #help
Avalonia UI Unable to find suitable setter or adder for property Styles
Am i trying even a good way to style this specific button? What im doing wrong?
5 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
should i worry about it right now?
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
im very begginer and just creating smple console game
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
actually i just need to get time from server
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
my app doesnt use multiple threads
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
what it actually means?
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
can i do that this way instead?
int GetServerTime()
{
using var client = new HttpClient();
try
{
const string url = "http://XXX/";
var response = client.GetAsync(url).Result;
response.EnsureSuccessStatusCode();

var result = response.Content.ReadAsStringAsync().Result;
var serverTime = int.Parse(result);
return serverTime;
}
catch (HttpRequestException ex)
{
Console.WriteLine("Error: " + ex.Message);
throw;
}
}

void Test()
{
var time = GetServerTime();
Console.WriteLine(time);
}
Test();
int GetServerTime()
{
using var client = new HttpClient();
try
{
const string url = "http://XXX/";
var response = client.GetAsync(url).Result;
response.EnsureSuccessStatusCode();

var result = response.Content.ReadAsStringAsync().Result;
var serverTime = int.Parse(result);
return serverTime;
}
catch (HttpRequestException ex)
{
Console.WriteLine("Error: " + ex.Message);
throw;
}
}

void Test()
{
var time = GetServerTime();
Console.WriteLine(time);
}
Test();
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
so going further all method calls has to be awaited right?
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
im creating simple console game, is something wrong if all methods will be tasks?
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
okay thanks
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
Tavern is called by other method which is also called by other method ...
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
should i change all methods to Tasks?
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
its other function which is void type
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
only 2 tasks with async which are in sended code actually
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
no voids with async
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
at line 35 i used GetServerTime method
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
so my code looks like that https://paste.mod.gg/kfiopaarqyuu/
33 replies
CC#
Created by rallez on 7/1/2023 in #help
✅ Basic http client get request
okay that's work for me in this simple code, but now when im trying using so the GetServerTime method stays the same how do i send more code than discord allows without nitro? sohuld i use pastebin or something like that?
33 replies
CC#
Created by rallez on 6/10/2023 in #help
print out all pairs of natural numbers whose sum isequal to the entered number n
THANKS!
34 replies
CC#
Created by rallez on 6/10/2023 in #help
print out all pairs of natural numbers whose sum isequal to the entered number n
?
34 replies