Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Namespaces Question
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00942700
Message ID:
00942804
Vues:
15
Shawn,

The namespace keyword allows you to create globally-unique types and are typically used in a hierarchal fashion.
using System;

namespace Hierarchy1
{
   /// <summary>
   /// Summary description for Class1.
   /// </summary>
   class Class1
   {
      /// <summary>
      /// The main entry point for the application.
      /// </summary>
      [STAThread]
      static void Main(string[] args)
      {
      //
      // TODO: Add code to start application here
      //
      }

      public void Test()
      {
      }
}

   namespace Hierarchy2
   {
      class Class2
      {
      }
   }
}
However using namespace inside of your type definition will generate a CS1519 compiler error which makes sense if you think in terms of type and not methods.

Regards
Neil
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform