developer

Colors in JavaScript console

Question: ❓❓❓ Can Chrome’s built-in JavaScript console display colors? I want errors in red, warnings in orange and console.log‘s in green. Is that possible? Good Answer: 👌👌👌 In Chrome & Firefox (+31) you can add CSS in console.log messages: console.log('%c Oh my heavens! ', 'background: #222; color: #bada55'); The same Read more…

By admin, ago
developer

How can I get the application’s path in a .NET console application?

Question: ❓❓❓ How do I find the application’s path in a console application? In Windows Forms, I can use Application.StartupPath to find the current path, but this doesn’t seem to be available in a console application. Good Answer: 👌👌👌 System.Reflection.Assembly.GetExecutingAssembly().Location1 Combine that with System.IO.Path.GetDirectoryName if all you want is the Read more…

By admin, ago