D
D
Danila Dunno2019-10-21 00:29:21
.NET
Danila Dunno, 2019-10-21 00:29:21

How can I change the ApartmentState of an application's input stream (C#, .NET)?

I want to make a snake in the console .(Console Application .NET) [I know that this is a bit of a perversion, but still].
The question is: Can I change the ApartmentState parameter of the application's input stream to ApartmentState.STA (to read keystrokes from the keyboard)? And if so, how can I get the main input stream as a reference object?.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shai_hulud, 2019-10-21
@shai_hulud

[STAThread]
static void Main(string[] args) {
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question