C#

C

C#

We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.

Join

✅ Infinite Bandwidth Work-around?

I'm trying to make Dropbox work for infinite bandwidth, which I'm not sure how… My appt is like TikTok, but every video has been stored in Dropbox, the problem is the bandwidth. There must be a way to make this work and use your pc's bandwidth or another software or something else to avoid using 2TB of Dropbox's bandwidth in 1 day....

How to get EXE file?

Hi i just started coding in c# I was wondering how can i get an .exe file out of my Project. When i build it or publish it, it creates an exe file but in a Folder with more files so it cant get executed alone. I can only execute it when its in the Folder but how i actually make it executable without all the folders ? Ty for your help!...
No description

Is it possible to add Markup support to this text editor I made in Winforms?

I want to add markup support but I'm not even sure if Winforms makes this possible
No description

✅ how do i join two lists?

i have 4 lists i want to join together. the plus operator doesnt work for this, even when converting to arrays.

✅ How to learn Relational Databases?

Hello, sorry this is somewhat off topic for this server, but I think people here will be able to reccomend something. I'm looking to learn a database software, I've settled on postgres and now I want to learn. But I want to go at it from a theory side, not just knowing what SQL commands are what they do, but more the "why" of things. When I studied discrete math in uni we did relations, and I have a vague idea that the relation in relational database comes from that, so I want to explore that si...

ASP.NET Core (backend) + Avalonia UI (desktop frontend)

We are tasked to create an application for our project and we have to make sure that it can perform on kind of low-end hardware something like intel i3 7th gen and 8gb of ram, thats why I chose C# because my thinking is that if I try to create a web app is that I'd be working with the chromium engine which is slow (please correct me on this) We are tasked to create essentially 2 applications in one. The first application is Attendance Monitoring System and Student Management System. the Attendance monitoring system...

✅ EF: how to structure same EF select query with no tracking?

Hello, I need the exact same select query with and without tracking. Should I implement it in 2 separate methods or a single method with a bool parameter that would determine if the query will use tracking or not (e.g. SelectSomething(enableTracking = true))?...

Adding modding capabilities to my C# game

Here's a somewhat strange question that may just not have an answer. I'm working on a project where I'd like to have the game be moddable in sorta the same way Minecraft is, where the modder can create a Mixin class of an existing Minecraft class, and then add or replace code of that class. I'd like to go about it in a way that's natively supported by my game, which is also going to be open-source, and I'd prefer to not get an answer that's just "use interfaces and reflection", as that's not very freeing for what the user can actually change about the core game, only allowing additions to aspects of the game that use interfaces, rather than being able to add to or replace any code in the game. For the record, my game does not use a game engine, so suggestions about MelonLoader for Unity are off the table....

Blazor WebAssembly can't load

Hello, I have made a blazor wasm site and it worked fine some days ago, but now i can't even start any blazor wasm app on my pc? Idk if my dotnet (8.0.401) install is broken, I have tried reinstalling the sdk with no change. The screenshot is from a brand new blazor wasm app created from the built in template. I haven't changed anything in it. Anyone have any idea?
No description

Observer pattern and strategy pattern together?

I was reading chapter 2 in head first design patterns and the subject is a weather station and the observer has an update method that takes in the weather data from the weather station. Would it be ideal to be able to implement a strategy pattern for what the update method takes in?

How can i send text files with a discord bot?

I want to make a ticket system with my discord bot that would save the messages sent in a ticket channel into a text file, send the file to a channel when the ticket is closed, and then delete the file from my PC, how can I do this?

Sending files using HTTP

Using a "HttpListenerResponse" how I can send a file to the client

Async Task Help

How am I supposed to make this work, I'm unsure where to go from here.
Cannot implicitly convert type 'System.Threading.Tasks.Task<Square.Models.ListInvoicesResponse>' to 'Square.Models.ListInvoicesResponse
Cannot implicitly convert type 'System.Threading.Tasks.Task<Square.Models.ListInvoicesResponse>' to 'Square.Models.ListInvoicesResponse
...

✅ MAUI - Mutlitap Gesture

I haven't found anything on the net about "Multitap Gestures". I tried a few things, currently using "CommunityToolkit.Maui" with the "TouchBehavior". So I'm left with the question, is it even possible?...

[WPF] DragDrop problems

```cs private void ListBorder_MouseMove(object sender, MouseEventArgs e) { if (e.LeftButton != MouseButtonState.Pressed) return; if (sender is not Border border) return;...
No description

Payments - architectural dilemma

Hi everyone 👋 I'm working on a complex payment application that needs to integrate multiple payment providers (Stripe, PayPal, etc.). I've been pondering the best architectural approach and would love to get some insights from someone who has experience with Payments. My main dilemma is:...
No description

Not writing, but not returning errors

```cs private void button1_Click(object sender, EventArgs e) { try {...

✅ Launch app at window startup

How can I make my app launch automatically at window startup ? Like windows defender for example

Getting Out of Memory Exception when loading in images

I get a system out of memory error after calling Image.FromFile in GetTarget(). How should I fix this? ```cs public ImageManager() {...