कंसोल की इनपुट एन्कोडिंग योजना को बदलने के लिए, कंसोल का उपयोग करें। इनपुट एन्कोडिंग गुण।
उदाहरण
आइए एक उदाहरण देखें -
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Linq;
using System.Text;
class Demo {
public static void Main (string[] args) {
Console.BackgroundColor = ConsoleColor.Blue;
Console.WriteLine("Background color changed = "+Console.BackgroundColor);
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\nForeground color changed = "+Console.ForegroundColor);
Console.InputEncoding = Encoding.ASCII;
Console.WriteLine("Input Encoding Scheme = "+Console.InputEncoding);
Console.CursorTop = 20;
Console.WriteLine("\nCursorTop = "+Console.CursorTop);
}
} आउटपुट
यह निम्नलिखित आउटपुट देगा -
