Академический Документы
Профессиональный Документы
Культура Документы
By Miss S.V.Koparde
using System; class TestApp { public static void Main () { Console.WriteLine ("Testing! 1, 2, 3"); } } Save the file in a convenient location (e.g., C:\CscExample) as TestApp.cs
By Miss S.V.Koparde
By default, the assembly name is the same as the name of the initial input *.cs file (in the case of a *.dll) or the name of the type containing the programs Main() method (in the case of an *.exe)
csc /out:My.exe File.cs
2) /target:exe This option builds an executable console application This is the default file output type, and thus may be omitted when building this application type
By Miss S.V.Koparde
3) /target:library This option builds a single-file *.dll assembly csc /target:library File.cs
4) /target:module This option builds a module Modules are elements of multifile assemblies 5)/target:winexe
Although you are free to build Windows-based applications using the /target:exe flag, the /target:winexe flag prevents a console window from appearing in the background
By Miss S.V.Koparde
Compiling Multiple Source Files using System; using System.Windows.Forms; class HelloMessage { public void Speak() { MessageBox.Show("Hello..."); } }
By Miss S.V.Koparde
By Miss S.V.Koparde
C# Language Fundamentals
C# demands that all program logic is contained within a type definition (class, interface, structure,enumeration, delegate The Anatomy of a Simple C# Program: //C# files end with a *.cs file extension. using System; class HelloClass { public static int Main(string[] args) { Console.WriteLine("Hello world"); return 0; } }
By Miss S.V.Koparde
Alternative to the standard for loop C# "foreach" keyword. // Notice we have no need to check the size of the array when using //'foreach'. public static int Main(string[] args) { foreach(string s in args) Console.WriteLine("Arg: {0} ", s); ... }
By Miss S.V.Koparde