· This morning Microsoft announced that it will be releasing shared
source implementations of the .NET Common Language Infrastructure (CLI),
C# compiler, and ECMAscript compiler for both Windows and FreeBSD.
The license will be considerably more liberal than the shared source
...
· using System;
using System.Net;
using System.Text;
using System.Collections.Specialized;public class WebClientSample
{
public static void Main()
{
try {
// Download the data to a buffer
WebClient client = new WebClient(); ...
· using System.Text.RegularExpressions;class Test {
static string CapText(Match m) {
// get the matched string
string x = m.ToString();
// if the first char is lower case
if (char.IsLower(x[0])) {
// capitalize it
return char.ToUpper(x[0]) + ...
· using System;
using System.Collections;
using System.Text;public class SamplesHashtable {
public static void Main() {
// Create and initialize a new Hashtable.
Hashtable table = new Hashtable();
//Student Name, Grade
table.Add("Jay&q...
· // Snippet shows how interfaces and coclasses can adorn the Guid attribute.
// Running the regasm will generate .reg and .tlb files. Reg file can be
// used to register the interface and coclass with the registry. Tlb file
// are used to do interop. Also illustrates how Sy...
· 1、建立一个文本文件
public class FileClass
{
public static void Main()
{
WriteToFile();
}
static void WriteToFile()
{
StreamWriter SW;
SW=File.CreateText("c:\MyTextFile.txt");
SW.WriteLine("God is greatest of them all");...
· Singleton Pattern in CSharp
Level Author
Beginner Kunal Cheda Singleton assures that there is one and only one instance of the class and provides a global point of access to it.There are number of cases in programming where you need to make sure that there can be one and on...
· Observer Design Pattern in C#!--------------------------------------------------------------------------------Author Level
Ashish Dhar Intermediate This article describes a very important and one of the powerful tools in C#.This is based on a famous design pattern called Obs...
· Exception Handling in C# Level Author
Intermediate Anonymous What 抯 Wrong with Return Codes?
Most programmers have probably written code that looked like this:
bool success =CallFunction();
if (!success)
{
//process the error
}
This works okay, but every return value has t...