[Solved] C an I stop my console app opening new window everytime I click the exe using a singleton pattern and without using a mutex [duplicate]

C an I stop my console app opening new window everytime I click the exe using a singleton pattern and without using a mutex [duplicate] solved C an I stop my console app opening new window everytime I click the exe using a singleton pattern and without using a mutex [duplicate]

[Solved] Remove space left after console scrollbars in C#

Finally, after a lot of head-scratching, I think I’ve solved this issue. Firstly, I had to add some additional WinAPI methods: [DllImport(“kernel32.dll”, SetLastError = true)] private static extern IntPtr GetStdHandle(int nStdHandle); [DllImport(“kernel32.dll”, SetLastError = true)] private static extern bool GetConsoleScreenBufferInfoEx( IntPtr hConsoleOutput, ref ConsoleScreenBufferInfoEx ConsoleScreenBufferInfo); [DllImport(“kernel32.dll”, SetLastError = true)] private static extern bool SetConsoleScreenBufferInfoEx( IntPtr … Read more

[Solved] Trying to show a Windows Form using a DLL that is imported at the runtime in a console application

The problem is that Activator.CreateInstance does not return ExpandObject (dynamic). You should run test() by reflection, like this : foreach (Type type in DLL.GetExportedTypes()) { dynamic c = Activator.CreateInstance(type); MethodInfo methodInfo = type.GetMethod(“test”); methodInfo.Invoke(c , null); } 2 solved Trying to show a Windows Form using a DLL that is imported at the runtime in … Read more

[Solved] “Hello world” c# program appear for a split of a second with Visual Studio [closed]

You are probably running the application in debug, without something to prevent it to close as soon as the job gets done. Basically, your code executes, and the application shuts because there is nothing else left to do. Two solutions: do as Štěpán Šubík recommands : put a Console.ReadKey(); start the application without debugging (Ctrl+F5 … Read more

[Solved] Opening a text file is passed as a command line parameter [closed]

A starting point. Then what you want to do with the contents of the file is up to you using System.IO; // <- required for File and StreamReader classes static void Main(string[] args) { if(args != null && args.Length > 0) { if(File.Exists(args[0])) { using(StreamReader sr = new StreamReader(args[0])) { string line = sr.ReadLine(); …….. … Read more