background preloader

C#

Facebook Twitter

A flexible charting library for .NET. Introduction ZedGraph is a class library, Windows Forms UserControl, and ASP web-accessible control for creating 2D line, bar, and pie graphs of arbitrary datasets.

A flexible charting library for .NET

The classes provide a high degree of flexibility - almost every aspect of the graph can be user-modified. At the same time, usage of the classes is kept simple by providing default values for all of the graph attributes. Windows Forms User Settings in C# Introduction This morning, for the first time, I was jealous of VB.NET programmers.

Windows Forms User Settings in C#

The My.Settings namespace makes loading and saving user settings pretty easy, and it’s pretty well documented. Unfortunately, C# programmers don’t have anything quite as slick as the My.Settings namespace, and the procedure for persisting user settings is not well-documented. It turns out that it is pretty easy to persist user settings in C#, and this article will show you how to do it. We’re going to stick to the basics—nothing fancy. We will create settings for the application window’s size and location properties, and we will persist them between runs of the program.

Catching Unhandled Exceptions. This example shows how to manage all exceptions that haven't been caught in the try-catch sections (in Windows Forms application).

Catching Unhandled Exceptions

The UnhandledException event handles uncaught exceptions thrown from the main UI thread. The ThreadException event handles uncaught exceptions thrown from non-UI threads. static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Application.Run(new Form1()); } static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) { MessageBox.Show(e.Exception.Message, "Unhandled Thread Exception"); } static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { MessageBox.Show((e.ExceptionObject as Exception).Message, "Unhandled UI Exception"); }

Manipulating Local User Accounts. Manipulating Local User Accounts In this blog I wil show some easy codes to Create, and manipulate a local user account.

Manipulating Local User Accounts

In my code I will be utilising the WinNT provider. Creating a local user account. This.Pose() as Expert. When you are working with Windows Vista, you know that even the administrative users are stripped ("filtered") of their privileges for normal operations, and that when you have to perform tasks requiring administrative privileges, you are presented with an UAC elevation prompt.

this.Pose() as Expert

The idea of this blog post series is to provide you with working samples on how to work with elevation from inside managed applications (you might also want to read Windows Vista Application Development Requirements for User Account Control Compatibility). I want to side-step the really easy part - providing a manifest to start the entire application elevated (a good idea if the application makes no sense at all unless it has administrative rights, like regedit.exe). Lock, Stand By, Hibernate and Log Off. Contextual Ads More C# Resources Advertisement Download this project (Visual Studio 2005) We're going to create a sample Windows application which will be capable of locking the PC using the existing station locking feature in Windows XP, put the operating system in Stand By and Hibernation, and finally logging off the current user.

Lock, Stand By, Hibernate and Log Off

Let us start by creating a Windows Application project inside Visual Studio 2005. How to: Obtain Font Metrics. The following illustration shows the various metrics.

How to: Obtain Font Metrics

The following illustration shows the output of the example code. For example, you can convert the ascent from design units to pixels as follows: Note that the em height (also called size or em size) is not the sum of the ascent and the descent. The sum of the ascent and the descent is called the cell height. The cell height minus the internal leading is equal to the em height. Codes sources, forum, tutoriaux et astuces. Basic Client/Server Chat Application In C# - C# Tutorials. An Anti-Reverse Engineering Guide. Download source code - 4.87 KB Table of Contents Introduction In my previous article, I gave a short introduction into some Anti-Debugging/Debugger Detection techniques that primarily involved the use of Win32 API functions.

An Anti-Reverse Engineering Guide

In this article, I plan to travel a bit deeper into the interesting world of reverse engineering and explore some more intermediate level techniques for annoying reverse engineers. Some comments in my previous article noted that the techniques I presented could, and are most of the time, easily bypassed by intermediate level reversers; one statement I would like to make is that there is an ongoing battle between the coders who develop programs that protect against cracking and reverse engineering and the engineers themselves.

Background. C# Exploit Monday. Ashutosh Nilkanth's .NET Blog - FileSystemWatcher Tips. The .NET FileSystemWatcher class makes it possible to quickly and easily launch business processes when certain files or directories are created, modified, or deleted.

Ashutosh Nilkanth's .NET Blog - FileSystemWatcher Tips

The FileSystemWatcher class, for example, can be quite useful in application integration, by way of monitoring incoming data files and processing it once an event is raised. It listens to the file system change notifications and raises events when a directory, or file(s) in a directory, changes. The component can watch files on a local computer, a network drive, or a remote computer. Tutoriel sur la serialisation en C# - Partie 1 » Ace-Dev. Pré requis : Visual studio c# (Express ou autres édition).net Framework Développement : Nous allons commencer par développer un simple carnet d’adresses, dans lequel on pourra ajouter des personnes, ainsi que sauvegarder et charger le carnet d’adresse par le biais de la sérialisation, une façon rapide et facile de travailler la translation entre les objets et les fichiers.

Tutoriel sur la serialisation en C# - Partie 1 » Ace-Dev

Commençons tout d’abord par créer le projet comme ce qui suis. Fnr.exe - Find And Replace Tool - Home. AutoResetEvent Class (System.Threading) Transferring files using SFTP in C# - Smoky Cogs. C# does not have native capabilities to use SFTP, but fortunately there are libraries available to do this. Most of these libraries are commercial libraries, but there are two that are open-source and free to use. These are SharpSSh by a guy called Tamir Gal, and Granados. SharpSSH is a relatively easy library to use, and allows either a straight SSH connection, or provides a wrapper to transfer files. The code to send a file to a remote server is rather easy using this library. SharpSSH - A Secure Shell (SSH) library for .NET. Using NUnit in Visual Studio 2010 – marthijn.

Like in older versions of Visual Studio it is possible to use NUnit as an external tool in the new 2010 version. By creating a toolbar as well it is very easy to run your test suite. The usual way to add an external command is by clicking the menu Tools -> External Tools. However, by default this menu item is not visible. To enable this menu item go to Tools -> Settings -> Expert Settings. The first step is download and install the latest version of NUnit since older versions are not compatible with .NET 4. Now go to Tools -> External Tools: Abstract Class versus Interface. Download source files - 8.75 KB Introduction.

Msdn.microsoft.com/en-us/library/bb130322.aspx#Y697. Writing C# Custom Events. By Budi Kurniawan 04/15/2002 Anyone doing Windows programming must have done some event handling in some way or another: capturing the double-click of a button, handling the click of a menu item, reacting to the moving of the mouse pointer over a label, and so forth. Howto: (Almost) Everything In Active Directory via C# Table of Contents. How to check for user inactivity with and without platform invokes in C# Introduction.