background preloader

C#

Facebook Twitter

Certificate Filtering. Solutions cross mobile dev .Net / C# Portable Class Libraries. Updated: August 2011 The Portable Class Library project enables you to write and build managed assemblies that work on more than one .NET Framework platform.

Portable Class Libraries

You can create classes that contain code you wish to share across many projects, such as shared business logic, and then reference those classes from different types of projects. Using the Portable Class Library project, you can build portable assemblies that work without modification on the .NET Framework, Silverlight, Windows Phone 7, or Xbox 360 platforms. Without the Portable Class Library project, you must target a single platform and then manually rework the class library for other platforms. The Portable Class Library project supports a subset of assemblies from these platforms, and provides a Visual Studio template that makes it possible to build assemblies that run without modification on these platforms. To create a Portable Class Library project, you must install the following in the specified order: API Differences in Portable Class Library. These changes corrected inconsistencies between the different releases of the types.

API Differences in Portable Class Library

You will encounter these changes only when you are working in a Portable Class Library project in Visual Studio 2012. For example, in Silverlight, the System.Net.HttpWebRequest class contains a property named SupportsCookieContainer, but this property did not exist in the System.Net.HttpWebRequest class in the .NET Framework 4. For the Portable Class Library, the SupportsCookieContainer property was added to the .NET Framework to make the types consistent. Partial Class. Partial classes span multiple files.

Partial Class

How can you use the partial modifier on a C# class declaration? With partial, you can physically separate a class into multiple files. This is often done by code generators. Keywords Example. Microsoft .NET Gadgeteer. C# versus JAVA. C# versus JAVA. Für was ist Gas geeignet?

C# versus JAVA

Namespace visibility in C# Java has package scoping.

Namespace visibility in C#

It allows an element to be visible only within the same namespace. It's a wonderful thing. Here's how it works in Java: package com.pc-doctor.mynamespace; package class Foo { ... } Free C# Compilers and Interpreters. C# is an object-oriented programming language created by Microsoft.

Free C# Compilers and Interpreters

This page lists free C# compilers, interpreters and integrated development environments (IDEs) for writing C# computer programs. Related Pages Free C# Compilers Microsoft Visual C# Express 2013 Microsoft XNA Game Studio Express. Mono 1.0 Release Notes. The Mono Project: Provides a superior development environment for writing Linux applications with unprecedented productivity.

Mono 1.0 Release Notes

Allows developers to write rich client, web services and server-side applications and deploy them on Linux, Solaris, MacOS X, Windows NT/XP and various other Unix systems on a variety of architectures. Delivers tools that facilitate the creation of product APIs and SDKs that are language independent across multiple operating systems. You can learn more about a particular area in the following parts of the release notes: Detailed Component Release Notes: Documents the differences from the Microsoft implementation and known issues with the software. Current Users Mono, in addition to running many of the existing .NET software (or popular software adapted to it) such as NAnt, NUnit and NGallery) is used elsewhere.

Tuto (C#)

String manipulation (Select where …) C# - Where does System.Diagnostics.Debug.Write output appear? Extension Methods (C# Programming Guide) Extension methods enable you to "add" methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type.

Extension Methods (C# Programming Guide)

Extension methods are a special kind of static method, but they are called as if they were instance methods on the extended type. For client code written in C# and Visual Basic, there is no apparent difference between calling an extension method and the methods that are actually defined in a type. DataView RowFilter Syntax. This example describes syntax of DataView.RowFil­ter expression.

DataView RowFilter Syntax

It shows how to correctly build expression string (without „SQL injection“) using methods to escape values. Column names If a column name contains any of these special characters ~( ) # \ /= >< + -* % & | ^' " [ ], you must enclose the column name within square brackets [ ]. If a column name contains right bracket ] or backslash \, escape it with backslash (\] or \\).

Select clause (C# Reference) The document is archived and information here might be outdated In a query expression, the select clause specifies the type of values that will be produced when the query is executed.

select clause (C# Reference)

The result is based on the evaluation of all the previous clauses and on any expressions in the select clause itself. DataTable.Select, méthode (String) (System.Data) Le document est archivé et les informations affichées ici peuvent être obsolètes .NET Framework (current version) public DataRow[] Select( string filterExpression ) Paramètres filterExpression private void GetRowsByFilter() { DataTable table = DataSet1.Tables["Orders"]; // Presuming the DataTable has a column named Date. string expression; expression = "Date > #1/1/00#"; DataRow[] foundRows; // Use the Select method to find all rows matching the filter. foundRows = table.Select(expression); // Print column 0 of each returned row. for(int i = 0; i < foundRows.Length; i ++) { Console.WriteLine(foundRows[i][0]); } }

Visual Basic - same size images in data grid view. Certificate Filtering. Certificates from SmartCard in C# C# - ProtectedConfigurationProvider using Rsa and x509 certificate. Svn - What Visual Studio files should be ignored by subversion to minimize conflicts? .net - how to play a specific windows error sound in c# When Is Each Sound From A Windows Sound Scheme Played? A few days ago, one of our readers asked us an interesting question: "is there a place where I can check when does a Windows sound play? ". While we have shown how to customize the sound scheme in Windows, we did not talk about when each system sound is played. That's why we decided to answer this question and detail when each system sound is played by Windows. Let's get started: NOTE: If you want to learn how to change the sounds used by Windows, read this tutorial: How To Customize The Sound Scheme Used On Your Windows Computer.

What Are The Program Events That Are Included In A Sound Scheme? You can customize the sound scheme used by your Windows computer from the Sound window, found in the Control Panel. In the Sound window you'll notice a section called Program Events. C# - Selecting sounds from Windows and playing them. Dispose Vs Close methods. C# - Add Files Into Existing Zip.

ZipArchive Class (System.IO.Compression)

Bridge .Net & Java

Applying Small Updates by Patching the Local Installation of the Product (Windows) The document is archived and information here might be outdated A small update can be applied to an application by patching the local installation of the application. To apply a small update patch to a local installation of the product. Minor Upgrades (Windows) The document is archived and information here might be outdated For information on how to apply a minor upgrade, see the following topics: Patching and Upgrades (Windows) The document is archived and information here might be outdated Because an installation package can contain the files that make up an application as well the information needed for their installation, Windows Installer can be used to update the application.

The installer can update information in the following parts of the installation package: List(T).ForEach Method (Action(T)) (System.Collections.Generic) The document is archived and information here might be outdated .NET Framework (current version) Performs the specified action on each element of the List<T>. public void ForEach( Action<T> action ) The Action<T> is a delegate to a method that performs an action on the object passed to it. The elements of the current List<T> are individually passed to the Action<T> delegate. 64bit - 32 or 64 bit DLL loading from .Net managed code.

C# - How to remove all event handlers from a control. C# - Capture screenshot of active window? Méthode Graphics.CopyFromScreen (System.Drawing) La pomme de terre, un aliment à éviter ? - Le Blog d'Erwann. Capturing screenshots in .NET and Mono. ScreenshotMonitor/ScreenshotCapture. StructLayoutAttribute.Pack, champ (System.Runtime.InteropServices) Using System; struct ExampleStruct { public byte b1; public byte b2; public int i3; } Process.Start Examples: Process Type. C# - How can I launch a URL in the users default browser from my application? How To: Execute command line in C#, get STD OUT results. Executing an exe file from C# code. Process.Start, méthode (String) (System.Diagnostics) Hide console window from Process.Start C# Common Infrastructure Libraries for .NET.

Logging - C# Log4Net - dynamically change log directory programmatically. .net - Dynamically reconfigure Log4Net. C# - How to dynamically set log file using App.config and System.Diagnostics? Log4Net Tutorial pt 3: Appenders. I've discussed using XML to configure lognet, during which I briefly touched on log4net appenders. An appender is an object that persists your log messages someplace. In this post, I'd like to give you a quick overview of the wealth of apppenders available in log4net and show you how you can use them to direct a single log message to multiple places. A Quick Survey Here is a quick sampling of the appenders available in the log4net distribution: There's a lot of them, so to keep this post reasonable I'm focusing on the most basic appenders: the console appenders, debug appenders, and file appenders.

ConsoleAppender and ColoredConsoleAppender These appenders are useful only for console applications, where they provide immediate feedback during program execution. There is one configurable aspect of the ConsoleAppender - the target property identifies what output stream to use when outputting log entries: to the same output from the ColoredConsoleAppender: Blue Green Red Yellow Purple Cyan White. C# - How to check if another instance of the application is running.

WebClient with automatic configuration script proxy setting is not working. Hi, C# - What's the difference between WebRequest.DefaultWebProxy and WebRequest.GetSystemWebProxy()? WebRequest.GetSystemWebProxy Method (System.Net) The document is archived and information here might be outdated.

Mono C# .net