How to rename a project folder in Visual Studio

Example folder name ‘PortableMedia’ that I wish to rename to ‘Renishaw.IDT.Powers.PortableMedia’: Step 1: Close the VS solution and nename the folder in source control ‘PortableMedia’ Gets changed to ‘Renishaw.IDT.Powers.PortableMedia’: Re-open the solution. Observe that the renamed project that is now marked as unavailable in the Solution Explorer: Open the Properties pane on that unavailable folder: …

Continue reading ‘How to rename a project folder in Visual Studio’ »

How to run processes and obtain the output in C#

Example process: fsutil. Very useful link on obtaining and setting fsutil behaviour and properties at this following link: http://blogs.microsoft.co.il/skepper/2014/07/16/symbolic_link/ Typically contained in the System32 folder: C:\Windows\System32 It is quite simple to do and consists of two main steps: Step 1: Create Process object and set its StartInfo object accordingly Step 2: Start the process and …

Continue reading ‘How to run processes and obtain the output in C#’ »

Using Google Docs Viewer to embed online documents into your web page

Some instructions on using Google Docs Viewer to embed online documents into your web page. Step 1: use the iframe tag to create an “internal” frame within your document So the essential part of embedding online documents into your we page is to use the iframe tag in your html. The iframe tag accepts 3 …

Continue reading ‘Using Google Docs Viewer to embed online documents into your web page’ »

Using SQLite in C# / .NET Environments

A quick how-to guide on setting up and using SQLite in C# / .NET environments. Nothing complicated just instructions on installing SQLite and using its APIs for database creation and querying. Much credit must go to this splendid link on helping me understand SQLite’s usage: http://blog.tigrangasparian.com/2012/02/09/getting-started-with-sqlite-in-c-part-one/ Step 1. Create a Visual Studio console application Step …

Continue reading ‘Using SQLite in C# / .NET Environments’ »

How to use delegates in C#

A simple guide to using delegates in C#. It should be suitable for anybody but is particularly aimed at C/C++ programmers who are more used to using function pointers and function objects as a means of passing function parameters. For the C/C++ equivalent of using callbacks see this link: https://www.technical-recipes.com/2016/how-to-write-callbacks-in-c/ Step 1: declare the delegate …

Continue reading ‘How to use delegates in C#’ »

How to make an HTTP request to an HTTP-based service in C#

A minimalist explanation as follows. 1. Create the HTTP Web Request Create the WebRequest object from the from the Universal Resource Identifier (URI) you supply eg 2. Send the HTTP request and wait for the response 3. Create a StreamReader object The StreamReader object is used to read back the text characters from the HTTP …

Continue reading ‘How to make an HTTP request to an HTTP-based service in C#’ »

How to write callbacks in C++

A simple guide to writing function callbacks in C++. For the C# equivalent of using delegate see this link: https://www.technical-recipes.com/2016/how-to-use-delegates-in-c The steps you need to take are: 1. Declare the function pointer that will be used to point to functions of given return types/argument(s) In this example a pointer to function that takes and int …

Continue reading ‘How to write callbacks in C++’ »

Serializing data in C# using Migrant

Antmicro Migrant is available from here: https://github.com/antmicro/Migrant To get started do the following steps: 1. Create a new console application in Visual Studio: 2. Install the ‘Migrant’ NuGet package Select Tools > NuGet Package Manager > Package Manager Console: Install Migrant by typing ‘install-package migrant’ 3. A simple serialization example. Modify your Program.cs to perform …

Continue reading ‘Serializing data in C# using Migrant’ »

Using the .NET WebBrowser Control in a WinForms project

Very easy to do. Just execute the following steps: 1. Create a new WinForms Project 2. Add the WebBrowser control from the ToolBox. Select View > ToolBox. Select WebBrowser in the Common Controls: 3. Drag the WebBroswer control on to your form Like so: 4. Add Event handling methods. Add an event for the form …

Continue reading ‘Using the .NET WebBrowser Control in a WinForms project’ »