C#

C

C#

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

Join

EasyHook issue

Has anyone here used EasyHook? I have a scenario: Computer A runs a program ProcessA and keeps calling a method MethodA. However, for some reason, MethodA cannot take effect. But I have another computer B that can run a program and call MethodB and send the result back to A through TCP. But it is necessary to replace MethodA on computer A. After looking up some information, I found that it can be implemented by using Hook. ...
No description

✅ Apparently the file thats right there does not exist???

Just check the image attached I mean seriously what? This is on the arduino.
No description

Loading XML results in list longer than XML

I'm struggling with this, am not sure what to search for, and I can't really post a code snippet as it's part of a larger project. I have a List<int> that is part of a class that gets saved/serialized to XML. When I load the XML, it's creating a List multiple times longer than what is in the XML. I've created breakpoints and watch the List, and during XML loading, the List goes from an exception (as expected because default class value is a new empty list), to 152 once loaded, while the XML/List only contains 16 elements....
No description

how to add inheritance between two c# files?

ive created tw c# files one called Pirate.cs and Gang.cs . I have John Adams in Gang.cs and i want pirate.cs to print it out but it doesnt work. could anyone help me find out the proper way to do inheritance in c# and how to get my code to work? Pirate.cs using System; ...
No description

Azure SWA Github Action failure

I have a static web app that I want to just serve an index.html, but my github action is failing with: 2025-01-01T07:49:26.9203515Z : The content server has rejected the request with: BadRequest 2025-01-01T07:49:26.9204633Z: Reason: No matching Static Web App was found or the api key was invalid. ...

Crashes on events trying to read data across threads

Error: An exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll but was not handled in user code The cross-thread operation is invalid: The control simconnectstatus was obtained from a different thread than the thread on which it was created. Using .net framework 4.7.2 ...

Which HTML Viewer would you recommend for WPF .NET 6+ platform?

Hi, I'm looking for a simple and lightweight HTML Viewer with CSS/JS support. It should only display HTML content and, if possible, execute JS code. No navigation through links is needed....

✅ help me for uni project

hey guys! happy new year! i'm so weak in programming but i need to do C# project for my university. Can somebody help me please? this is the task: Develop a quiz application that allows users to answer questions and accumulate points, covering basic C# topics. When the program file is run the output should be a simple welcoming page, a start option and an exit option. When the user selects start the program should display premade questions that you coded into your program and gain points that per correct answer. The main tools for this project is listed between sections (1-5) and in section (6) you can find example questions for...

Executing explorer.exe into virtualdesktop

First of all, Happy New Year! I'm working on a project in C#, I'm using the CreateDesktop API to create a desktop and draw it to a PictureBox. However, there's an issue: the explorer.exe is not loading into the virtual desktop it spawns into the default desktop, and nothing is being drawn into the PictureBox. The process is running in admin mode. I believe the flow is as follows: ...

Using Visual Studio Microsoft Forms .NET Framework C#

I want to create a label that covers most of the screen after pressing a button. I have set the Visible property to False It works as intended currently, but how can I make it disappear in this design window?...
No description

Include File into Blazor Emscripten VFS

Trying to figure out the proper way to include a bunch of files into the Blazor emscripten VFS so as to be accessible from file system calls performed against the emscripten version of read()/open() etc

Resource to learn C#

Hello guys, sorry to disturb you all, I want to learn C# for the basics till advanced level. Can anyone suggest some good resources where I can learn it, practice what I learn and learn by doing please. I need to learn it for uni... I also need to learn ".NET" but don't really know what it is, is it related to C# please

Named Pipes Connection

Hey everybody! I'm trying to support Windows in a project and I'm trying to connected to the Discord named pipe (an IPC server) that runs on Windows when the Discord client is open. So far I did this (and a bit more but this is not the point):```cs var pipe = new NamedPipeClientStream( @"\.\pipe\discord-ipc-0",...

Small Lists issue

im trying to check if a list remained the same after a prozess: ''' List<string> startList=previousList; previousList.Add("item"); Console.Writeline(startList==previousList); '''...

small issue

im making a game of tic tac toe but i have 0 idea as to how i implement the system that checks whether 3 crosses or zeroes have been added..

BAD IMAGE QUALITY (Bitmap)

Making a functionnality to add image to a page, but when i save it the quality is just horrible. It feel like on screen the image difference are the same, but there is very a big quality difference. Is there a way to make it look way better? Code : ```cs using (Bitmap bmp = new Bitmap(pageImage.Width, pageImage.Height)) { pageImage.DrawToBitmap(bmp, new Rectangle(0, 0, pageImage.Width, pageImage.Height));...
No description

LEARNING C#

I’m learning C# for Unity game development from a YouTuber named "CodeMonkey," and I’ve reached the intermediate section. However, I’m confused about how to implement the code I’ve learned in Unity. For example, I’ve learned how to create a class, but I don’t understand where and how to use that code in Unity.

PersistedAssemblyBuilder to generate executable

Hello! I'm trying to generate IL executable from C# via PersistedAssemblyBuilder. I'm running into issues where the generated IL throws an exception:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.
...
No description

what type of pattern would u use?

Particle Manager, Particle Emitter. each particle emitter has its own animation output 'json' i need some kind of emittergroup or multiemitter that share 1 animation output...