MethodBase.GetCurrentMethod メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > MethodBase.GetCurrentMethod メソッドの意味・解説 

MethodBase.GetCurrentMethod メソッド

現在実行中のメソッドを表す MethodBase オブジェクト返します

名前空間: System.Reflection
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Shared Function GetCurrentMethod
 As MethodBase
Dim returnValue As MethodBase

returnValue = MethodBase.GetCurrentMethod
public static MethodBase GetCurrentMethod ()
public:
static MethodBase^ GetCurrentMethod ()
public static MethodBase GetCurrentMethod ()
public static function GetCurrentMethod
 () : MethodBase

戻り値
現在実行中のメソッドを表す MethodBase オブジェクト

使用例使用例
Imports System
Imports System.Reflection
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Messaging
Imports System.Security.Permissions

Namespace RemotingSamples
   <SecurityPermission(SecurityAction.Demand, Flags:=SecurityPermissionFlag.Infrastructure)>
 _
   Public Class HelloServer
      Inherits MarshalByRefObject
      
      Public Sub New()
         Console.WriteLine("HelloServer activated")
      End Sub 'New
      
      <OneWay(), SecurityPermission(SecurityAction.Demand, Flags:=SecurityPermissionFlag.Infrastructure)>
  _
      Public Sub HelloToServer(name As
 String)
         Console.WriteLine("Hello.HelloToServer : {0}",
 name)
      End Sub 'HelloToServer
      
      <SecurityPermission(SecurityAction.Demand, Flags:=SecurityPermissionFlag.Infrastructure)>
 _
      Public Function HelloToServerAndWait(name
 As String) As String
         Console.WriteLine("Client invoked HelloToServerAndWait
 : " + name)
         Console.WriteLine("Client waiting for return? {0}",
 _
                   IIf(RemotingServices.IsOneWay(MethodBase.GetCurrentMethod()),"No"
,"Yes"))
         Return "Hi there, " +
 name
      End Function 'HelloToServerAndWait
   End Class 'HelloServer
End Namespace 'RemotingSamples
using System;
using System.Reflection;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Messaging;
using System.Security.Permissions;

namespace RemotingSamples 
{
  [SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.Infrastructure)]
  public class HelloServer : MarshalByRefObject
 
  {
    [SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.Infrastructure)]
    public HelloServer() 
    {
      Console.WriteLine("HelloServer activated");
    }

    [OneWay(), SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.Infrastructure)]
    public void HelloToServer(String name)
 
    {
      Console.WriteLine("Hello.HelloToServer : {0}", name);
    }

    [SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.Infrastructure)]
    public String HelloToServerAndWait(String name)
    {
       Console.WriteLine("Client invoked HelloToServerAndWait : " + name);
       Console.WriteLine("Client waiting for return?
 {0}",
          RemotingServices.IsOneWay(MethodBase.GetCurrentMethod()) ? "No"
 : "Yes");
       return "Hi there, " + name;
    }
  }
}
#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;
      }

   };

}

.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からMethodBase.GetCurrentMethod メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からMethodBase.GetCurrentMethod メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からMethodBase.GetCurrentMethod メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「MethodBase.GetCurrentMethod メソッド」の関連用語

MethodBase.GetCurrentMethod メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



MethodBase.GetCurrentMethod メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS