I need to specify the correct codepage to pack the files with zip library. As I see, I need to specify console encoding (866 in my case).

 C:\Users\User>mode

 Status for device CON:
 ----------------------
     Lines:          300
     Columns:        130
     Keyboard rate:  31
     Keyboard delay: 1
     Code page:      866 <- I need to get this value in C# code

Console.OutputEncoding returns 1251, which is not what I need.

Thanks,

Alex

Update 1: Obviously, execute "mode" in cmd.exe and parse output should work but it seems too rude. I'm looking for .NET solution.

Update 2: The application is windows forms application, not a console app.

Edit
Report