RSS

Category Archives: Dotnet/C#

C# Websocket programming: the simplest example


Create a winform Application:

image

Read the rest of this entry »

Advertisements
 
8 Comments

Posted by on July 23, 2015 in Dotnet/C#, Programming

 

Tags: , , , , , , , ,

Visual Studio 2015 RTM ISO/offline download links: official links


Visual Studio Enterprise 2015 (x86 and x64) – DVD (English)
SHA1:07C949078F895CE0D9C03A1B8D55571A8C90AC94

Visual Studio Professional 2015 (x86 and x64) – DVD (English)
SHA1:E01F364C3F21CDFCEBB25D3C028398741F08EB24

Visual Studio Community 2015 – (English)
SHA1:BAAD3CEBAB7A5834D8F78F7D02E4880C010F3BA9

Visual Studio Test Professional 2015 (x86 and x64) – DVD (English)
SHA1: A532B03F4B461DE68F4A86D34F478F2C87F6413D

Visual Studio 2015 SDK (x86 and x64) – (English)
SHA1:6CC9DE044EAB28B6CF2E298990320D116DC37036

Modeling SDK for Visual Studio 2015 (x86 and x64) – (English)
SHA1:0E748AB43E7135D8692947DC946FCEA207DDC7FB

Microsoft Build Tools 2015 (x86) – (Multiple Languages):18 MB
SHA1:ABF9EFBCFE2B896C07EB14B97E0FC972F1BBAAD8

All from official Microsoft sites! Enjoy!

 
13 Comments

Posted by on July 21, 2015 in Dotnet/C#, Programming

 

Tags: , , , , , , , , ,

Using Redis with C# (II): Coding


Now that you have installed Redis on your system, let’s jump to the actual coding using C#. If you wish to get the detailed procedures to install Redis, click here.

  • Create a winform project in Visual Studio
  • Install the nuget package by running the following command in the Package Manager Console

PM> Install-Package ServiceStack.Redis

Add a button and a button click event handler:

              private void button1_Click(object sender, EventArgs e)
        {
            string elementKey = “TableId”;
            using (var redisClient = new RedisClient(host, port, password))
            {
                if (redisClient.Get<string>(elementKey) == null)
                {
                    redisClient.Set(elementKey, “12345678”);
                }
                else
                    redisClient.Set(elementKey, “87654321”);
                // get value from the cache by key
                var message = “Item value is: “ + redisClient.Get<string>(elementKey);
                MessageBox.Show(message);
            }
        }

Read the rest of this entry »

 
Leave a comment

Posted by on July 14, 2015 in Dotnet/C#, Programming

 

Tags: , , , , , ,

Using Redis with C# (I): Installation of Redis


image  image

You might wish to get the latest windows installer for Redis here as well.

  • Run redis-service application in the installation folder:

Read the rest of this entry »

 
1 Comment

Posted by on July 14, 2015 in Dotnet/C#, Programming

 

Tags: , , , , , ,

Using MySQL with C# (III): Coding in C#


  • Install the nuget package: in the nuget management console, type below line and run

Install-Package MySql.Data

  • Let’s create a class SqlUtils, and in the static constructor, type below code:
                
                  static
    SqlUtils()
            {
                try
                {
                    con = new MySqlConnection(connectionStr);
                    con.Open(); //open the connection
                    Console.WriteLine(“Successfully opened database.”);
                }
                catch (MySqlException err) //Catch MySql errors
                {
                    Console.WriteLine(“Error: “ + err.ToString());
                }
            }

where the connection string is:

Read the rest of this entry »

 
1 Comment

Posted by on July 13, 2015 in Dotnet/C#, Programming

 

Tags: , , , , , ,

Using MySQL with C# (II): Creating a DB for programming


You might be interested in how to install MySQL in windows, check up this link for details.

  • Run MySQL workbench after clicking Finish

image_thumb[23]  image_thumb[24]

  • In the MySQL workbench, copy below scripts to create a new database called “MyBooks”:

create database MyBooks

  • Select the above script line, then click the thunder icon to execute the sql statement
  • A new DB is created, as shown in the left DB group:

image   image

Read the rest of this entry »

 
1 Comment

Posted by on July 13, 2015 in Dotnet/C#, Programming

 

Tags: , , , , , ,

Using MySQL with C# (I): MySQL Installation


MySQL is a free database and can be easily used in your .Net Applications. This quick-start goes through the typical process that involves installation, up and running your “Hello MySQL” application.

If you are not interested in the MySQL installation, skip this and go directly to the below topics:

Using MySQL with C# (II): Creating a DB for programming
Using MySQL with C# (III): Coding in C#

  • Download MySQL server here or if you already had an oracle account, go directly here.
  • Accept the license, and select the product/platform to download, click “Go”
  • Download the installer

image  image

  • Unzip and run the installer, follow the instructions.
  • Select the options, in my case, I choose “Full”

Read the rest of this entry »

 
1 Comment

Posted by on July 13, 2015 in Dotnet/C#, Programming

 

Tags: , , , , , , ,