background preloader

C# Programming

Facebook Twitter

Finally, an interactive tutorial series that WILL teach you C# for Unity3D. Making a Simple Game in Unity (Part 1) - Unity C# Tutorial. C# Tutorial for Absolute Beginners. PID process control, a “Cruise Control” example. Overview This code is a working example of a PID (Proportional, Integral, Derivative) control.

PID process control, a “Cruise Control” example

This type of a control is used when processes change due to inertia. (A car's cruise control is a PID controller.) The PID algorithm is surprisingly simple, and can be implemented in five lines of code. There are three constants that must be determined in order to shape the control's output. How are PID loops used? How to: Write Text to a File. .NET Framework 4.6 and 4.5 The following examples show how to write to a text file from a console app, a Windows Presentation Foundation (WPF) app and a Windows Store app.

How to: Write Text to a File

This example reads all the text files from the user's My Documents folder by searching for "*.txt", and synchronously writes them into a large text file. GUI Windows Forms « C# / CSharp Tutorial.  C# Language. C# Essentials. Creating a Database in Microsoft Visual Studio 2010. Hello friends, hope you all are enjoying good health.

Creating a Database in Microsoft Visual Studio 2010

Around two to three months ago, I have shared a topic on Microsoft Visual Basic 2010 – Com Port in which I have explained completely how to make the serial communication in Microsoft Visual studio using visual basic language. Sending Email in Microsoft Visual Studio 2010. Hello friends, today’s tutorial is about adding functionality in Microsoft Visual Studio 2010 basic email form.

Sending Email in Microsoft Visual Studio 2010

In the previous part of this tutorial How to Send Email in Microsoft Visual Studio 2010, we have seen a basic email form which just sends email to constant email address which is specified in the coding. Today we will make this email form a bit flexible and will be able to send the emails to any email id we want. If you have read the previous part of this tutorial, then this article will be nothing for you, you will got it just like a piece of cake instantly. So, I suppose that you have read the previous tutorial and you have the knowledge of smtp etc so I am not gonna explain it further, so i suggest again to read it first if you have any doubt in configuration part, lets come to this part. Steps to follow: Now the last part is adding code so go into your code editor and remove all the previous code and place this code in it. Things to Notice: Note: theenggprojects. Microsoft Visual Basic 2010 – Com Port Tutorial. Update: Few bugs were reported by some readers, which I have corrected and updated the code.

Microsoft Visual Basic 2010 – Com Port Tutorial

Now, its fully tested and 100% working. Computer Science Design Patterns - Wikibooks, open books for an open world. The term Design Patterns can confuse you at first, or it can seem like something incredibly difficult.

Computer Science Design Patterns - Wikibooks, open books for an open world

In fact it is nothing more than convenient ways of identifying, labelling and coding general solutions to recurring design problems. So design patterns are nothing more than commonly occurring patterns in design that are repeatable and generalist enough to be written down and named as software design constructs that all can commonly identify and apply. Note however that a design pattern refers to the logical structure of the code, what it does and how it addresses the issues, not on direct code portability across projects, but in the portability of the way design issues can be addressed. Imagine yourself working in a project team and someone just wrote a class and is trying to explain to you that only one instance is allowed.

Instead the person could simply say "The class I just wrote is a Singleton". Development stages. The Sandpit: Bing Web Search in C# This blog post contains a C# wrapper of the Bing API (Microsoft’s internet search engine).

The Sandpit: Bing Web Search in C#

In my previous post I presented a similar wrapper for Google’s Custom Search API, successor to the Web Search API. I was frankly less than impressed with Google custom search API as it appears to be engineered to favor specific themes and/or domains. The Sandpit: Google Custom Search in C# This post contains a C# class to search the internet using Google’s custom search API.

The Sandpit: Google Custom Search in C#

Before using this class you must first create a Google account (link) and generate an API key (link). In this sample, I called the Google search API from a WPF application, but it would also work in a WinForms or ASP.NET application as suggested above. Here is the XAML of the Window that displays the results of the Google search. public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); And here is the class that calls Google’s custom search API, desterilizes the JSON response and returns the result as single .NET objects. Download C# Code Samples for the Live Search API from Official Microsoft Download Center. <a id="b7777d05-f9ee-bedd-c9b9-9572b26f11d1" target="_self" class="mscom-link download-button dl" href="confirmation.aspx?

Download C# Code Samples for the Live Search API from Official Microsoft Download Center

Electronic Component API download. Overview - Octopart API. The Octopart API is the easiest way for developers to access up-to-date pricing and availability information, datasheets, compliance documents and technical specs for electronic components from distributors and manufacturers around the world.

Overview - Octopart API

Using the Octopart API, you can access stocking information, price breaks, lead times, minimum order quantities and much more information from over 100 distributors including Digi-Key, Mouser, Newark, Premier Farnell, Arrow, RS Components, Future Electronics, Grainger and many others. You can also access millions of datasheets and compliance documents for parts from over 4000 manufacturers.

Authentication The Octopart API does not require any usernames or passwords to use, however it does require a valid API key for every request. Quick-start sample app for C# / .NET   This quick-start sample app is built in .NET and lets you get started with the Google+ platform in a few minutes. The app demonstrates: Using the Google+ Sign-In button to get an OAuth 2.0 refresh token.

Exchanging the refresh token for an access token. Making Google+ API requests with the access token, including getting a list of people that the user has circled. Disconnecting the app from the user's Google account and revoking tokens. System requirements Supported operating systems:WindowsVisual Studio 2010 and later Step 1: Enable the Google+ API Create a Google Developers Console project, OAuth 2.0 client ID, and register your JavaScript origins:

Google/google-api-dotnet-client. C# Essentials. How to: Write Text to a File. The following examples show how to write text to a text file. The first example reads all the text files from the user's My Documents folder by searching for "*.txt", and synchronously writes them into a large text file. using System; using System.IO; using System.Text; using System.Collections.Generic; class Program { static void Main(string[] args) { string mydocpath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); StringBuilder sb = new StringBuilder(); foreach (string txtName in Directory.EnumerateFiles(mydocpath,"*.txt")) { using (StreamReader sr = new StreamReader(txtName)) { sb.AppendLine(txtName.ToString()); sb.AppendLine("= = = = = ="); sb.Append(sr.ReadToEnd()); sb.AppendLine(); sb.AppendLine(); } } using (StreamWriter outfile = new StreamWriter(mydocpath + @"\AllTxtFiles.txt")) { outfile.Write(sb.ToString()); } } }

GUI Windows Forms « C# / CSharp Tutorial. C# Applet  I want to tell you how to write C# Applet, display it in a web page and the requirement. The requirement first, your C# Applet won'twork anywhere nor from anywhere. You should put (and test) it on IIS,for unknown reason (at last unknown to me) this won't work locally orwith apache.