Create DLL : DLL « Development Class « C# / C Sharp






Create DLL

Create DLL

// C:\> csc /target:module Test.cs


namespace CSharpVBInterface {
      using System;
    
      public class Test {
       public Test() {} 
    
       public int DaysInMonth( string monName )
       {
         if ( monName == "September" || monName == "April" || monName == "June" || monName == "November" )
            return 30;
    
         if ( monName == "February" )
            return 28;
         return 31;
       }
       public string DayName( int dayNo ) {
         switch ( dayNo ) {
            case 0:
             return "Sunday";
            case 1:
             return "Monday";
            case 2:
             return "Tuesday";
            case 3:
             return "Wednesday";
            case 4:
             return "Thursday";
            case 5:
             return "Friday";
            case 6:
             return "Saturday";
         }
         return "Unknown";
      }
   }
}
           
       








Related examples in the same category

1.Build with the following command-line switches: csc /t:library DllTestServer.cs
2.Compile cs file to DLL
3.Load system dll library
4.Create DLL library