Sound
Sound
CC#
Created by Sound on 10/4/2023 in #help
❔ [WINFORMS] Make textbox scale vertically according to its content.
No description
11 replies
CC#
Created by Sound on 9/14/2023 in #help
❔ TextBox stretching according to the window size
27 replies
CC#
Created by Sound on 9/8/2023 in #help
✅ HttpClient Get Page Content
I need a method RequestHelper.GetContent(string url) that returns the url's html as string. I also need a method that can get the page content as binary, so i can download files.
21 replies
CC#
Created by Sound on 7/30/2023 in #help
❔ Map COM1 to IPv4
I am working on a software that manages some PLCs with modbus rtu over tcp. I need a way to map a com port to an ip address when my program starts. I am currently using a serial server from moxa (nport 5150a) and it has a driver that does this mapping. However, I don t want my app to depend on someone else's drivers. How can i do this?
4 replies
CC#
Created by Sound on 7/25/2023 in #help
❔ Build for Win, Linux & Mac at once
How can i make the solution build for all platforms, with platform specific executables? When i build the solution i want both linux and windows executables
7 replies
CC#
Created by Sound on 7/25/2023 in #help
✅ If statement meaning
Does if (Segments[i].Type is not SegmentType.Junction or SegmentType.Tail) mean if(Segments[i].Type != SegmentType.Junction && Segments[i].Type != SegmentType.Tail)) ?
10 replies
CC#
Created by Sound on 6/18/2023 in #help
❔ Foreach
in c++ i can do :
auto objects = std::vector<Object>();
for(auto& obj : objects) {...} // here i can modify obj (move, remove etc)
for(auto obj : objects) {...} // here i can't move/delete obj from objects
auto objects = std::vector<Object>();
for(auto& obj : objects) {...} // here i can modify obj (move, remove etc)
for(auto obj : objects) {...} // here i can't move/delete obj from objects
From what i know, in C# this doesn t allow me to remove, move, modify objects.
var objects = new List<Object>();
foreach(var obj in objects) {...}
var objects = new List<Object>();
foreach(var obj in objects) {...}
How can i do something like this for(auto& obj : objects) without having to use indices?
9 replies
CC#
Created by Sound on 5/22/2023 in #help
✅ Memory leaks and idk how to solve them
Why does the following code produce memory leaks? Shouldn't bg get deleted and then reallocated?
Background bg = new();

while (!Raylib.WindowShouldClose())
{
Raylib.BeginDrawing();

bg.Dispose();
bg=new();

Raylib.DrawText(Raylib.GetFPS().ToString(), 10, 10, 20, Color.RED);

Raylib.EndDrawing();
}
Background bg = new();

while (!Raylib.WindowShouldClose())
{
Raylib.BeginDrawing();

bg.Dispose();
bg=new();

Raylib.DrawText(Raylib.GetFPS().ToString(), 10, 10, 20, Color.RED);

Raylib.EndDrawing();
}
bg.Dispose();
bg=new();
bg.Dispose();
bg=new();
Why do these constantly allocate new memory and the old one doesn t get freed up? And how do i make it work?
36 replies