@manhng

Welcome to my blog!

Applied Microsoft .NET Framework Programming

December 19, 2018 09:07

Applied Microsoft .NET Framework Programming (edit)

The .NET Framework Class Library

XML Web services Methods that can be accessed over the Internet very easily. XML Web services are, of course, the main thrust of Microsoft’s .NET initiative.

Web Forms HTML-based applications (Web sites). Typically, Web Forms applications will make database queries and Web service calls, combine and filter the returned information, and then present that information in a browser using a rich HTML-based user interface. Web Forms provides a Visual Basic 6 and Visual InterDev style development environment for Web applications written in any CLR language.

Windows Forms Rich Windows GUI applications. Instead of using a Web Forms page to create your application’s UI, you can use the more powerful, higher performance functionality offered by the Windows desktop. Windows Forms applications can take advantage of controls, menus, and mouse and keyboard events, and they can talk directly to the underlying operating system. Like Web Forms applications, Windows Forms applications also make database queries and call XML Web services. Windows Forms provides a Visual Basic 6Ðlike development environment for GUI applications written in any CLR language.

Windows console applications For applications with very simple UI demands, a console application provides a quick and easy way to build an application. Compilers, utilities, and tools are typically implemented as console applications.

Windows services Yes, it is possible to build service applications controllable vi a the Windows Service Control Manager (SCM) using the .NET Framework.

Component library The .NET Framework allows you to build stand-alone components (types) that can be easily incorporated into any of the previously mentioned application types.

OOP in CSharp Example

using System;
internal class Test { // Constructor public Test() { } // Destructor ~Test() { } // Operator overload public static Boolean operator ==(Test t1, Test t2) { return true; } public static Boolean operator !=(Test t1, Test t2) { return false; } // An operator overload public static Test operator +(Test t1, Test t2) { return null; } // A property public String AProperty { get { return null; } set { } } // An indexer public String this[Int32 x] { get { return null; } set { } } // An event private event EventHandler AnEvent; }

Building Types into a Module

public class App
{
    static public void Main(System.String[] args)
    {
        System.Console.WriteLine("Hi");
    }
}

Build

csc.exe /out:App.exe /t:exe App.cs
csc.exe App.cs

Reflection

using System.Reflection;

ProductName: System.Reflection.AssemblyProductAttribute
ProductVersion: System.Reflection.AssemblyInformationalVersionAttribute

FileDescription: System.Reflection.AssemblyTitleAttribute
FileVersion: System.Reflection.AssemblyVersionAttribute

System.Resources.ResourceManager
System.Reflection.AssemblyCultureAttribute

The System.Reflection.AssemblyName class is a helper class that makes it easy for you to build an assembly name and to obtain the various parts of an assembly’s name. The class offers several public instance properties, such as CultureInfo, FullName, KeyPair, Name, and Version. The class also offers a few public instance methods, such as GetPublicKey, GetPublicKeyToken, SetPublicKey, and SetPublicKeyToken

You know the Strong Name Utility, SN.exe, that ships with the .NET Framework SDK and Visual Studio .NET

You know the Global Assembly Cache Utility, GacUtil.exe

Categories

Recent posts