Adsense code (2021-10-05)

Sunday, November 29, 2015

MonoDevelop/C#: get the current running Common Language Runtime verion, with the Environment.Version property.

Read the Environment.Version Property to gets a Version object that describes the major, minor, build, and revision numbers of the common language runtime.

For the .NET Framework Versions 4, 4.5, 4.5.1, and 4.5.2, the Environment.Version property returns a Version object whose string representation has the form 4.0.30319.xxxxx. For the .NET Framework 4.6, it has the form 4.0.30319.42000.

Example:
using System;

namespace HelloWorldCsharp
{
    class MainClass
    {
        public static void Main (string[] args)
        {
            Console.WriteLine ("Hello World!");

            /*
             * For the .NET Framework Versions 4, 4.5, 4.5.1, and 4.5.2, 
             * the Environment.Version property returns a Version object whose 
             * string representation has the form 4.0.30319.xxxxx. 
             * 
             * For the .NET Framework 4.6, it has the form 4.0.30319.42000.
             * 
             * ref: https://msdn.microsoft.com/en-us/library/system.environment.version(v=vs.110).aspx
            */
            Console.WriteLine("Version: \t" + Environment.Version.ToString());
            Console.WriteLine("(Major): \t" + Environment.Version.Major.ToString());
            Console.WriteLine("(Minor): \t" + Environment.Version.Minor.ToString());

            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
    }
}



MonoDevelop/C# to keep console open with ReadKey()


In C# console program, we can keep console open by inserting the code Console.ReadKey():
using System;

namespace HelloWorldCsharp
{
    class MainClass
    {
        public static void Main (string[] args)
        {
            Console.WriteLine ("Hello World!");
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
    }
}

MonoDevelop on Kubuntu: Hello World C# example



using System;

namespace HelloWorldCsharp
{
    class MainClass
    {
        public static void Main (string[] args)
        {
            Console.WriteLine ("Hello World!");
        }
    }
}

Create a Hello World C# example in MonoDevelop run on Kubuntu:

Install MonoDevelop on Kubuntu 15.10 with Muon Discover Software Center

MonoDevelop enables developers to quickly write desktop and web applications on Linux, Windows and Mac OS X. It also makes it easy for developers to port .NET applications created with Visual Studio to Linux and Mac OS X maintaining a single code base for all platforms.

It can be installed on Kubuntu with Muon Discover Software Center. But the current installed version is 5.5, not the current latest version of 5.9.7.


Install MonoDevelop on Kubuntu 15.10 (run on VirtualBox) with Muon Discover Software Center, and create Hello World Project of Gtk# 2.0.


Install Qt on Kubuntu 15.10/VirtualBox


This video show how to install Qt/Qt Creator on Kubuntu 15.10 running on Oracle VirtualBox:

Install KDevelop on Kubuntu 15.10/VirtualBox, using Muon Discover Software Center



This video show how to install KDevelop on Kubuntu 15.10/VirtualBox, using Muon Discover Software Center:


Wednesday, November 25, 2015

Install Qt/Qt Creator on Ubuntu 15.10



To download Qt, visit Qt Download page.

Remark:
- In my case of installing on Ubuntu 15.10 running on VirtualBox, have to disable VirtualBox's 3D Acceleration.
- build-essential and libgl1-mesa-dev are needed, install with comand:
sudo apt-get install build-essential libgl1-mesa-dev

This video show the steps to download and install Qt/Qt Creator on Ubuntu 15.10:

Tuesday, November 24, 2015

Install KDevelop on Ubuntu 15.10, using Ubuntu Software Center


KDevelop is an easy to use integrated development environment for KDE. It supports a wide range of programming languages and features project management, an advanced editor, a class browser and an integrated debugger.

The application wizard can generate fully functional projects for terminal programs and GUI programs using Qt, KDE or GNOME.

https://www.kdevelop.org/

It can be installed using Ubuntu Software Center.



Hello World KDevelop