Export (0) Print
Expand All

MethodBase.GetCurrentMethod Method

Returns a MethodBase object representing the currently executing method.

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)

public:
static MethodBase^ GetCurrentMethod ()
public static MethodBase GetCurrentMethod ()
public static function GetCurrentMethod () : MethodBase

Return Value

A MethodBase object representing the currently executing method.

#using <system.dll>
#using <system.runtime.remoting.dll>

using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::Remoting;
using namespace System::Runtime::Remoting::Messaging;
using namespace System::Security::Permissions;

namespace RemotingSamples
{
   public ref class HelloServer: public MarshalByRefObject
   {
   public:
      HelloServer()
      {
         Console::WriteLine( "HelloServer activated" );
      }


      [OneWay]
      void HelloToServer( String^ name )
      {
         Console::WriteLine( "Hello::HelloToServer : {0}", name );
      }

      [SecurityPermissionAttribute(SecurityAction::Demand, Flags=SecurityPermissionFlag::Infrastructure)]   
      String^ HelloToServerAndWait( String^ name )
      {
         Console::WriteLine( "Client invoked HelloToServerAndWait : {0}", name );
         Console::WriteLine( "Client waiting for return? {0}", RemotingServices::IsOneWay( MethodBase::GetCurrentMethod() ) ? (String^)"No" : "Yes" );
         return "Hi there, {0}",name;
      }

   };

}


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft