nukleer bomb
nukleer bomb
CC#
Created by Ole on 11/15/2023 in #help
Deserializing binary data
16 replies
CC#
Created by Ole on 11/15/2023 in #help
Deserializing binary data
If you just need a binary (de)serializator, then you can use MemoryPack
16 replies
CC#
Created by ♡Mr. L0stík♡ on 11/13/2023 in #help
How to store data?
MessagePack is still better if you need to interop with other languages
17 replies
CC#
Created by ♡Mr. L0stík♡ on 11/13/2023 in #help
How to store data?
17 replies
CC#
Created by ♡Mr. L0stík♡ on 11/13/2023 in #help
How to store data?
Yeah, JSON is the easiest way to go. But if you have a lot of data and need to be compact and performant, then you can try using some binary serializer
17 replies
CC#
Created by AceChewy on 11/11/2023 in #help
✅ Editing Project File caused Solution to break
It looks like you removed the wrong line. Can you show the edited project file?
13 replies
CC#
Created by AceChewy on 11/11/2023 in #help
✅ Editing Project File caused Solution to break
Show the full error
13 replies
CC#
Created by AceChewy on 11/11/2023 in #help
✅ Editing Project File caused Solution to break
Yeah since you already have the same line in the right place
13 replies
CC#
Created by AceChewy on 11/11/2023 in #help
✅ Editing Project File caused Solution to break
UseWindowsForms is a property, and should be inside ProperyGroup block
13 replies
CC#
Created by MarkusSchaber on 9/16/2023 in #help
❔ How to convert a hex string to a Span<byte>?
You can avoid using byte.Parse() something like this:
if(char >= '0' && char <= '9')
num = char - '0';
else if(char >= 'A' && char <= 'F')
num = char - 'A';
else
throw;
if(char >= '0' && char <= '9')
num = char - '0';
else if(char >= 'A' && char <= 'F')
num = char - 'A';
else
throw;
23 replies
CC#
Created by lars on 8/13/2023 in #help
❔ Output to console if run from console - otherwise do not create console window?
OutputType == WinExe
13 replies
CC#
Created by lars on 8/13/2023 in #help
❔ Output to console if run from console - otherwise do not create console window?
Try using AttachConsole(ATTACH_PARENT_PROCESS);:
const uint ATTACH_PARENT_PROCESS = 0x0ffffffff;

[DllImport("kernel32.dll")]
static extern bool AttachConsole(uint dwProcessId);
const uint ATTACH_PARENT_PROCESS = 0x0ffffffff;

[DllImport("kernel32.dll")]
static extern bool AttachConsole(uint dwProcessId);
13 replies
CC#
Created by Theos on 8/4/2023 in #help
❔ Switch case on Int type
41 replies
CC#
Created by Theos on 8/4/2023 in #help
❔ Switch case on Int type
(also, can you use generics instead of typeof in your class?)
41 replies
CC#
Created by Theos on 8/4/2023 in #help
❔ Switch case on Int type
You have to use good ol' ifs
41 replies
CC#
Created by Theos on 8/4/2023 in #help
❔ Switch case on Int type
You can't switch on typeof() since it's not a constant
41 replies
CC#
Created by Theos on 8/4/2023 in #help
❔ Switch case on Int type
_type variable is of type Type?
41 replies
CC#
Created by Boats on 8/4/2023 in #help
Serializing a derived class with System.Text.Json
4 replies
CC#
Created by Boats on 8/4/2023 in #help
Serializing a derived class with System.Text.Json
You are getting this error not because of JSON serialization, but because covariance and contravariance https://learn.microsoft.com/dotnet/standard/generics/covariance-and-contravariance
4 replies
CC#
Created by Based on 8/1/2023 in #help
❔ Cannot convert System.Drawing.Image to string
Nope public static System.Drawing.Image FromFile(string filename);
132 replies