1 C#
... VS.NET VS.NET 2000 , XP 2000 XP
2000 / XPIIS SQL 2000 ( ) ( CD) VS.NET ( CD)
... IIS IIS 2000 IIS [FrontPage Server Extension] 2000 , IIS FAT32 , [Server Extension] .
2000 2.0 2.0 gkau, IIS OS
C# C# C# Main System.Console WriteLine
, C# []-[ ]-[]
C#
C#
C#
Class1 Hello , TODO
C#
Console . .
C#
[]-[]
Ctrl+F5 .
C#
C# Main , Main . Console , System Console.WriteLine( "Hello C#" );
(class) , C# Main
C# (method) C/C++ . , class Hello { }
(Member) (field), (method), (property), (event) . (instance) (static) (static) public int Method1( int n ) { return 0; } public static void Main() {}
FirstApp Hello
C# namespace TestProgram { namespace FirstApp { } } namespace TestProgram.FirstApp { }
using using
using .
Console System using TestProgram.FirstApp.Hello using TestProgram.FirstApp; // System System.Console.WriteLine( "Hello C#" );
WriteLine , WriteLine WriteLine "Hello" , ,
WriteLine "Hello" {0},{1} {0} {1}
C# , {0},{1}.{2},.. .Console.WriteLine( "string : {0}", "C#" ); Console.WriteLine( "int : {0}", 123 ); Console.WriteLine( "double : {0}", 123.456 );
Write Write Write
C# C/C++ \n' Console.Write( Hello ); Console.Write( C# Program ); Console.Write( Hello \n \n );
\' \n NewLine \" \r carriage Return \\\ Back Slash \t Tab \b Backspace \v Vertical Tab
double f = 1234.5678; Console.WriteLine( "{0:F}", f ); // "1234.56" Console.WriteLine( "{0:F4}", f ); // "1234.5678" Console.WriteLine( "{0,20:F4}", f ); // " 1234.5678" Console.WriteLine( "{0,-20:F4}", f ); // "1234.5678 "
Main
Main , void
void public static int Main() { return 0; } public static void Main() { }
Main
void return
Main string
Main arg1, arg2, arg3 string Main
public static void Main() { .... return; } app.exe arg1 arg2 arg3
Main
Length
using System; class Class1 { public static void Main( string[] args ) { // 1 if ( args.Length > 1 ) { Console.WriteLine( "[0] : {0}", args[0] ); Console.WriteLine( "[1] : {0}", args[1] ); } else Console.WriteLine( "[usage]: arglist /option1 /option2" ); } }
Main
Main
VS.NET VS.NET , . []
C# C# (class) - C# (method) - C# (method) .
System.Console - Console WriteLine {0}, {1}
Hello.Method(); Console.WriteLine( "{0} {1} {2}", "Hello", "C#", Programming );