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. 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: Creating a Dependency. API Differences in Portable Class Library. These changes corrected inconsistencies between the different releases of the types.

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. However, the SupportsCookieContainer property is not available to .NET Framework 4 users unless they are working in a Portable Class Library project. This topic describes the changes that were made to the types and members in the .NET Framework for the Portable Class Library, and any behavioral changes you might encounter.

Two new properties were added to System.Net.HttpWebRequest: Two new methods were added to System.Net.WebRequest: Partial Class. Partial classes span multiple files. 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 With normal C# classes, you cannot declare a class in two separate files in the same project. Partial is required here. Namespace Tip:To fix this, you can either use the partial keyword, or change one of the class names. Compiler How does the C# compiler deal with partial classes?

IL Disassembler So:Class A will contain the methods A1 and A2 in the same code block. Class Tip:Partial classes are precisely equivalent to a single class with all the members. Compiled result of A1.cs and A2.cs: C# internal class A { // Methods public static void A1() { Console.WriteLine("A1"); } public static void A2() { Console.WriteLine("A2"); } } Summary Partial classes can simplify certain C# programming situations. Microsoft .NET Gadgeteer. C# versus JAVA. C# versus JAVA. Für was ist Gas geeignet? Das verwendete Gas, welches zum Heizen verwendet wird, ist auch unter dem Begriff "Erdgas" wieder zu finden. Das vorhandene Gas stellt eines der wichtigsten Lieferanten für Energie dar. Neben dem Heizen eignet sich das Gas auch für das Kochen oder wird noch zusätzlich für die Stromerzeugung eingesetzt. Das Gas selbst wird unter anderem als meist benutztes Mittel für das Heizen angesehen.

Der Verbrauch ist hierzulande recht hoch. Eines der größten Gasanbieter stellen unter anderem Ruhrgas, Gasunie, Wingas, RWE Dea oder E.on dar. Wie sieht das mit den Preisen aus Die Preise in Bezug auf das Gas, kann man als nicht einheitlich bezeichnen, sodass diese aber in den letzten Jahren eher in die Höhe gegangen sind. Wie kann nun Geld gespart werden Zusätzlich wird ermöglicht, wenn ein guter Gaspreis Vergleich durchgeführt wird, dass Geld eingespart werden kann. Namespace visibility in C# Java has package scoping. 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 { ... } The class Foo is only visibile within mynamespace. Even though I'm not a Java programmer, this immediately strikes me as extremely useful. Frequently, helper classes are only needed by code that lives close by. There are two reasons to want namespace visibility to be enforced by your compiler: If you can make those classes invisible outside the namespace, it will make life a lot easier for clients of that namespace.

The Microsoft Way Microsoft expects you to make the classes internal. However, you have to make a separate assembly for each namespace that you want to do this with. Frankly, that's painful enough that few people do it. The C++ Way C++ also lacks namespace visibility. This is an easy thing to do, but it doesn't do much in C#. Getting the C# Compiler to Enforce Namespace Visibility. Free C# Compilers and Interpreters. C# is an object-oriented programming language created by Microsoft. 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 Develop non-commercial games in C# for Windows with the Microsoft XNA Game Studio Express. You will also need to download the Microsoft Visual C# Express Edition (see elsewhere on this page for the link). The Mono C# Compiler Mono is an open source cross-platform implementation of Microsoft's .NET Development Framework. Microsoft Visual C# 2010 Express Can't Find What You're Looking For? Search the site using Google. It will appear on your page as: Free C# Compilers and Interpreters. Mono 1.0 Release Notes. The Mono Project: Provides a superior development environment for writing Linux applications with unprecedented productivity. 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. Gtk#: Learn about Mono's toolkit for developing GUI applications. 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.

Inside of Novell, it is used as a development platform for projects including: Source code:

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 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. The most common extension methods are the LINQ standard query operators that add query functionality to the existing System.Collections.IEnumerable and System.Collections.Generic.IEnumerable<T> types.

To use the standard query operators, first bring them into scope with a using System.Linq directive. Then any type that implements IEnumerable<T> appears to have instance methods such as GroupBy<TSource, TKey>, OrderBy<TSource, TKey>, Average, and so on. The following example shows an extension method defined for the System.String class. DataView RowFilter Syntax. This example describes syntax of DataView.RowFil­ter expression. 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 \\). dataView.RowFilter = "id = 10"; dataView.RowFilter = "$id = 10"; dataView.RowFilter = "[#id] = 10"; dataView.RowFilter = "[[id\]] = 10"; Literals String values are enclosed within single quotes ' '.

DataView.RowFilter = "Name = 'John'" dataView.RowFilter = "Name = 'John ''A'''" dataView.RowFilter = String.Format("Name = '{0}'", "John 'A'".Replace("'", "''")); Number values are not enclosed within any characters. Date values are enclosed within sharp characters # #. Alternatively you can enclose all values within single quotes ' '. Comparison operators Functions. 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. The result is based on the evaluation of all the previous clauses and on any expressions in the select clause itself.

A query expression must terminate with either a select clause or a group clause. The following example shows a simple select clause in a query expression. class SelectSample1 { static void Main() { //Create the data source List<int> Scores = new List<int>() { 97, 92, 81, 60 }; // Create the query. The type of the sequence produced by the select clause determines the type of the query variable queryHighScores.

Example The following example shows all the different forms that a select clause may take. At compile time, the select clause is translated to a method call to the Select<TSource, TResult> standard query operator. 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]); } } .NET FrameworkDisponible depuis 1.1.

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. There you'll find a rather long list of events. These Program Events are divided into subsections. Depending on the software that you installed on your device, other sections might also be available. Conclusion. 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: The .msi file.The files of the application.The Windows Installer registration information.

The following table summarizes the different types of updates. List(T).ForEach Method (Action(T)) (System.Collections.Generic) 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 | Screenshot Monitor Blog. ScreenshotMonitor/ScreenshotCapture. StructLayoutAttribute.Pack, champ (System.Runtime.InteropServices) 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. C# - How to check if another instance of the application is running. WebClient with automatic configuration script proxy setting is not working. C# - What's the difference between WebRequest.DefaultWebProxy and WebRequest.GetSystemWebProxy()? WebRequest.GetSystemWebProxy Method (System.Net)

Mono C# .net