FCL

FCL is mean The .Net Framework Class Library
There are more than 7,000 types(Classes,structs,interfaces,enumerations and delegates) in FCL.
FCL is organized around 100 namespaces.The types discussed in this chapter are:
I/O(File and Stream)
Collections(Hash Tables and Dynamic Arrays)
Regular Expressions
Internet Classes(HttpWebRequest,HttpWebResponse,System.WebMail)
Data(DataReadears,DataSets,Data Adapters)
Reflection

 


using System;
using System.IO;


 public class Demo{    
    public static void Main(string[] args)
  {
 if (args.Length==0){
  Console.WriteLine("必须跟一个参数");
  return;
 }
 

 StreamReader r=null;
 
 try{
    r=new StreamReader(args[0]);
    for(string line=r.ReadLine();line!=null;line=r.ReadLine())
    Console.WriteLine(line);
 }catch(IOException e){
    Console.WriteLine(e.Message);
 }finally{
    if (r!=null)
  r.Close();
 }
 }
}

 

using System;


using System.Collections;

 public class Demo{    
    public static void Main(string[] args)
  {
 Hashtable table=new Hashtable();
 table["A"]="A元素";
 table.Add("B","B元素");
 
 foreach(DictionaryEntry e in table)
  Console.WriteLine("key={0},value={1}",e.Key,e.Value);


 Console.WriteLine("table中共有元素{0}个",table.Count);
 //table.Remove(Key); table.Clear();
  }

}


 


System.Web.Mail

It is quite easy to send e-Mail from a.NET Framework application(as long as you have the right permissions)

using System;
using System.Web.Mail;


 public class Demo{    
    public static void Main(string[] args)
  {
 MailMessage msg=new MailMessage();
 msg.From="[email protected]";
 msg.To="test.hotmail.com";
 msg.Subject="hahahahaahahahahahahahahahaha";
 msg.Body="悄悄";
 SmtpMail.SmtpServer="localhost";
 try{
 SmtpMail.Send (msg);
 }
 catch (Exception e){
 Console.WriteLine(e.Message);
 }
  }

}

你可能感兴趣的:(String,table,Collections,Class,permissions,delegates)