Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : COM and .Net (Windows) : DOTNET

DOTNET

DOTNET class ()
string DOTNET::DOTNET ( string assembly_name, string class_name [, int codepage] )

Synopsis

$obj = new DOTNET("assembly", "classname")

The DOTNET class allows you to instantiate a class from a .Net assembly and call its methods and access its properties.

Methods

DOTNET class constructor. assembly_name specifies which assembly should be loaded, and class_name specifices which class in that assembly to instantiate. You may optionally specify a codepage to use for unicode string transformations; see the COM class for more details on code pages.

The returned object is an overloaded object, which means that PHP does not see any fixed methods as it does with regular classes; instead, any property or method accesses are passed through to COM and from there to DOTNET. In other words, the .Net object is mapped through the COM interoperability layer provided by the .Net runtime.

Once you have created a DOTNET object, PHP treats it identically to any other COM object; all the same rules apply.

Example 407. DOTNET example

<?php
 $stack
= new DOTNET("mscorlib", "System.Collections.Stack");
 
$stack->Push(".Net");
 
$stack->Push("Hello ");
 echo
$stack->Pop() . $stack->Pop();
?>


Note:

You need to install the .Net runtime on your web server to take advantage of this feature.

Change Language


Follow Navioo On Twitter
COM
DOTNET
VARIANT
com_addref
com_create_guid
com_event_sink
com_get_active_object
com_get
com_invoke
com_isenum
com_load_typelib
com_load
com_message_pump
com_print_typeinfo
com_propget
com_propput
com_propset
com_release
com_set
variant_abs
variant_add
variant_and
variant_cast
variant_cat
variant_cmp
variant_date_from_timestamp
variant_date_to_timestamp
variant_div
variant_eqv
variant_fix
variant_get_type
variant_idiv
variant_imp
variant_int
variant_mod
variant_mul
variant_neg
variant_not
variant_or
variant_pow
variant_round
variant_set_type
variant_set
variant_sub
variant_xor
eXTReMe Tracker