_AppDomain.CreateInstanceFrom 方法

定義

為 COM 物件提供與版本無關的 CreateInstanceFrom 方法之存取權。Provides COM objects with version-independent access to the CreateInstanceFrom method.

多載

CreateInstanceFrom(String, String)

為 COM 物件提供 CreateInstanceFrom(String, String) 方法多載之與版本無關的存取權。Provides COM objects with version-independent access to the CreateInstanceFrom(String, String) method overload.

CreateInstanceFrom(String, String, Object[])

為 COM 物件提供 CreateInstanceFrom(String, String, Object[]) 方法多載之與版本無關的存取權。Provides COM objects with version-independent access to the CreateInstanceFrom(String, String, Object[]) method overload.

CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence)

為 COM 物件提供 CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) 方法多載之與版本無關的存取權。Provides COM objects with version-independent access to the CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) method overload.

CreateInstanceFrom(String, String)

為 COM 物件提供 CreateInstanceFrom(String, String) 方法多載之與版本無關的存取權。Provides COM objects with version-independent access to the CreateInstanceFrom(String, String) method overload.

public:
 System::Runtime::Remoting::ObjectHandle ^ CreateInstanceFrom(System::String ^ assemblyFile, System::String ^ typeName);
public System.Runtime.Remoting.ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName);
abstract member CreateInstanceFrom : string * string -> System.Runtime.Remoting.ObjectHandle
Public Function CreateInstanceFrom (assemblyFile As String, typeName As String) As ObjectHandle

參數

assemblyFile
String

檔案的名稱 (包括路徑),此檔案包含會定義要求之類型的組件。The name, including the path, of a file that contains an assembly that defines the requested type. 此組件使用 LoadFrom(String) 方法載入。The assembly is loaded using the LoadFrom(String) method.

typeName
String

FullName 屬性傳回的要求類型之完整名稱 (包括命名空間,但不包括組件)。The fully qualified name of the requested type, including the namespace but not the assembly, as returned by the FullName property.

傳回

ObjectHandle

對新執行個體而言是包裝函式的物件,但如果沒有找到 typeName,則為 nullAn object that is a wrapper for the new instance, or null if typeName is not found. 傳回值需要解除包裝以存取實際物件。The return value needs to be unwrapped to access the real object.

備註

請參閱 AppDomain.CreateInstanceFrom(String, String) 方法多載。See the AppDomain.CreateInstanceFrom(String, String) method overload.

適用於

CreateInstanceFrom(String, String, Object[])

為 COM 物件提供 CreateInstanceFrom(String, String, Object[]) 方法多載之與版本無關的存取權。Provides COM objects with version-independent access to the CreateInstanceFrom(String, String, Object[]) method overload.

public:
 System::Runtime::Remoting::ObjectHandle ^ CreateInstanceFrom(System::String ^ assemblyFile, System::String ^ typeName, cli::array <System::Object ^> ^ activationAttributes);
public System.Runtime.Remoting.ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, object[] activationAttributes);
abstract member CreateInstanceFrom : string * string * obj[] -> System.Runtime.Remoting.ObjectHandle
Public Function CreateInstanceFrom (assemblyFile As String, typeName As String, activationAttributes As Object()) As ObjectHandle

參數

assemblyFile
String

檔案的名稱 (包括路徑),此檔案包含會定義要求之類型的組件。The name, including the path, of a file that contains an assembly that defines the requested type. 此組件使用 LoadFrom(String) 方法載入。The assembly is loaded using the LoadFrom(String) method.

typeName
String

FullName 屬性傳回的要求類型之完整名稱 (包括命名空間,但不包括組件)。The fully qualified name of the requested type, including the namespace but not the assembly, as returned by the FullName property.

activationAttributes
Object[]

一或多個屬性的陣列,此屬性可參與啟動過程。An array of one or more attributes that can participate in activation. 一般來說,就是包含單一 UrlAttribute 物件的陣列。Typically, an array that contains a single UrlAttribute object. UrlAttribute 會指定啟動遠端物件所需的 URL。The UrlAttribute specifies the URL that is required to activate a remote object.

傳回

ObjectHandle

對新執行個體而言是包裝函式的物件,但如果沒有找到 typeName,則為 nullAn object that is a wrapper for the new instance, or null if typeName is not found. 傳回值需要解除包裝以存取實際物件。The return value needs to be unwrapped to access the real object.

備註

請參閱 AppDomain.CreateInstanceFrom(String, String, Object[]) 方法多載。See the AppDomain.CreateInstanceFrom(String, String, Object[]) method overload.

activationAttributes參數與用戶端啟動的物件(舊版技術)相關。The activationAttributes parameter is related to client-activated objects, a legacy technology.

適用於

CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence)

為 COM 物件提供 CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) 方法多載之與版本無關的存取權。Provides COM objects with version-independent access to the CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) method overload.

public:
 System::Runtime::Remoting::ObjectHandle ^ CreateInstanceFrom(System::String ^ assemblyFile, System::String ^ typeName, bool ignoreCase, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ args, System::Globalization::CultureInfo ^ culture, cli::array <System::Object ^> ^ activationAttributes, System::Security::Policy::Evidence ^ securityAttributes);
public System.Runtime.Remoting.ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes, System.Security.Policy.Evidence securityAttributes);
abstract member CreateInstanceFrom : string * string * bool * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo * obj[] * System.Security.Policy.Evidence -> System.Runtime.Remoting.ObjectHandle
Public Function CreateInstanceFrom (assemblyFile As String, typeName As String, ignoreCase As Boolean, bindingAttr As BindingFlags, binder As Binder, args As Object(), culture As CultureInfo, activationAttributes As Object(), securityAttributes As Evidence) As ObjectHandle

參數

assemblyFile
String

檔案的名稱 (包括路徑),此檔案包含會定義要求之類型的組件。The name, including the path, of a file that contains an assembly that defines the requested type. 此組件使用 LoadFrom(String) 方法載入。The assembly is loaded using the LoadFrom(String) method.

typeName
String

FullName 屬性傳回的要求類型之完整名稱 (包括命名空間,但不包括組件)。The fully qualified name of the requested type, including the namespace but not the assembly, as returned by the FullName property.

ignoreCase
Boolean

布林值,指出是否執行區分大小寫的搜尋。A Boolean value specifying whether to perform a case-sensitive search or not.

bindingAttr
BindingFlags

零或多個位元旗標的組合,此位元旗標會影響 typeName 建構函式的搜尋。A combination of zero or more bit flags that affect the search for the typeName constructor. 如果 bindingAttr 為零,則會針對公用建構函式執行區分大小寫的搜尋。If bindingAttr is zero, a case-sensitive search for public constructors is conducted.

binder
Binder

使用反映來啟用繫結、強制引數的類型、成員的引動過程,和擷取 MemberInfo 物件的物件。An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects through reflection. 如果 binder 為 null,則會使用預設繫結器。If binder is null, the default binder is used.

args
Object[]

要傳遞到建構函式的引數。The arguments to pass to the constructor. 這個引數陣列必須在數目、順序和類型上符合要叫用之建構函式的參數。This array of arguments must match in number, order, and type the parameters of the constructor to invoke. 如果慣用無參數建構函式,則 args 必須是空陣列或 Null。If the parameterless constructor is preferred, args must be an empty array or null.

culture
CultureInfo

特定文化特性的資訊,其可控制 args 到型式類型 (為 typeName 建構函式宣告) 的強制轉型。Culture-specific information that governs the coercion of args to the formal types declared for the typeName constructor. 如果 culturenull,會使用目前執行緒的 CultureInfoIf culture is null, the CultureInfo for the current thread is used.

activationAttributes
Object[]

一或多個屬性的陣列,此屬性可參與啟動過程。An array of one or more attributes that can participate in activation. 一般來說,就是包含單一 UrlAttribute 物件的陣列。Typically, an array that contains a single UrlAttribute object. UrlAttribute 會指定啟動遠端物件所需的 URL。The UrlAttribute specifies the URL that is required to activate a remote object.

securityAttributes
Evidence

用來授權建立 typeName 的資訊。Information used to authorize creation of typeName.

傳回

ObjectHandle

對新執行個體而言是包裝函式的物件,但如果沒有找到 typeName,則為 nullAn object that is a wrapper for the new instance, or null if typeName is not found. 傳回值需要解除包裝以存取實際物件。The return value needs to be unwrapped to access the real object.

備註

請參閱 AppDomain.CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) 方法多載。See the AppDomain.CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) method overload.

activationAttributes參數與用戶端啟動的物件(舊版技術)相關。The activationAttributes parameter is related to client-activated objects, a legacy technology.

適用於