C#

C

C#

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

Join

How to get the nvme serial number?

Hello everyone, does anyone know how to get the nvme serial number? Are the values ​​that I get using Win32_DiskDrive different from those shown by the same CrystalDiskInfo, or am I doing something wrong?...

any learning courses?

I am begginer in .NET and looking for education in this way as mobile/desktop or backend dev. Does somebody have really good courses for mobile/ desktop development that happen online or mentoring stuff? thx for any idea. ( i Dont look at Udemy or coursera)...

✅ Trouble porting to AOT JSON

I'm having some trouble making my json parsing aot-friendly. I have a lot of types to deserialize into, this is what I'm doing right now: ```csharp [JsonSerializable(typeof(A))] [JsonSerializable(typeof(B))]...

Help new to c# and need explanation with substring

Hey everyone I just started coding but now I'm learning about .IndexOf and substring I just don't know how it works. Like for example I wanted to do Initials (Take the first letter of the first name[text box 1]and the 2 first letters of the last name[text box 2]) as well as in 1 single textbox the initials same as before but it's not the same so can anyone please help me with this code 😭🙏🏿 Things I use -Visual studio -WindowsFormsApp...
No description

Help. Broken Rust plugin

Error while compiling TankCommander: No overload for method 'SetMounted' takes 2 arguments | Line: 523, Pos: 28

The best resources you used to learn C# in the beginning

Would you mind please sharing the best resources you used to learn C# when you first started, I'm eager to learn but I'm struggling to find resources which I can understand. I don't need my hand to be held throughout the whole thing but a lot of the resources I've came across don't really seem to explain things in depth (what things mean / what they do) and it can seem overwhelming quite quickly :/

Problem configuring a sql

Good evening, I'm downloading and configuring an SQL but I'm not able to enter the password. I've tried entering special characters, upper and lower case letters and it doesn't work. Does anyone know why?

Web API: structure

Hello, I have finished my DAL -> entities and their db context but what is next i dont know anybody and google didnt help much with my usecase

Passing an array as a parameter to an event

hello, i have these arrays, which needs to get passed towards the clientside
string[] names = new string[] { "Darius Campbell", "Andreea Gonzalez", "Michael Black" };
int[] money = new int[] { 100, 500, 200 };
player.TriggerEvent("SERVER:CLIENT:showCharInterface");
player.TriggerEvent("SERVER:CLIENT:displayAccountInfo", username, names, money);
string[] names = new string[] { "Darius Campbell", "Andreea Gonzalez", "Michael Black" };
int[] money = new int[] { 100, 500, 200 };
player.TriggerEvent("SERVER:CLIENT:showCharInterface");
player.TriggerEvent("SERVER:CLIENT:displayAccountInfo", username, names, money);
...

Learning further in C#

Hi. I've went to a basics course in C# and learnt arrays, variables, functions, loops, and some more stuff. I don't know what to do to contiune, I've looked up C# learning guides but theyre kinda like the course i took. Havent seen anything explain how programmers approach projects or how to actually write code and combine it with more code to create something desired. Can someone give me advice?...

✅ Having trouble going from the old syntax to top level statements

i have been learning C# using the old syntax. i do not know the name for it, but this is what it is: ```cs using System; class Program {...

Menu Validation 'char input'

I just asking for some general directions to design a solid input validation for a menu. It 'works' but I feel like I am using the wrong tools. I want it to only use a key press, that is fine. The overall come I wrote doesn't feel solid. ```cs static void Main()...

Visualization of obstacles

I have a robot position and obstacles detected by it, these are generated in logfile every second like this ``` 2024/10/31 18:08:20.971==>TopModule[13584]/57_SpeedControl.cs[742,ObstacleDistanceUpdate]_Now Position x[-21.1411003632192], y[13.2018284811866] ...

inheritance vs nested class

Suppose i want to create a Resources class. There are three type of resources: string resources, drawable resources, xml resources. Which one is better to implement the resources class: inheritance or nested class ? With inheritance, i create abstract class Resources, then create another class for each type of resources which inherit from Resources. With nested class, i create a static class Resources, then create a non-static class inside the Resources class for each resources types. For example, Resources.String, Resources.Drawable, etc....

.NET MAUI and Android Intents

Hey guys, I hate to be a bother, but I have a bit of a situation, is there anyone here that works with MAUI that could possibly help me? In short... I need to integrate with a phone that has a built in barcode scanner (UROVO DT50), and I managed to find the API documentation, but I for the life of me cannot grasp the concept of intents and how to use them in MAUI.

Call function when system time changed

I'm reading the Microsoft SystemEvents.TimeChanged and I'm having trouble understanding how to link my own function to call when the system time changes.

Vanila for loop snippet VS 2022

I'm trying to use the built-in code snippet for a for loop in Visual Studio 2022. When I type 'for' and press Tab, it should generate a basic for loop with an integer iterator, but it's not working. Is anyone else experiencing this issue?

Reset identity colums EF Core error.

Hi all, This is my seeding method: ```cs public async Task Seed()...

Jittery up and down transformation in unity

Hey, just wondering if anyone can help, im struggling with a jittery moving platform. im not sure if my code is the issue. Any help would be massively appreciated. ( the code works fine for side to side transformations but is jittery on up and down)
No description