当前位置: 首页>>代码示例>>PHP>>正文


PHP COM::Get方法代码示例

本文整理汇总了PHP中COM::Get方法的典型用法代码示例。如果您正苦于以下问题:PHP COM::Get方法的具体用法?PHP COM::Get怎么用?PHP COM::Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在COM的用法示例。


在下文中一共展示了COM::Get方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public static function run($dataDir = null)
 {
     if (is_null($dataDir)) {
         die("Data Directory Undefined");
     }
     // Create Aspose.Cells Helper Object
     $ptr = new \COM('Aspose.Cells.Interop.InteropHelper');
     // Opening through Path
     // Creating a Workbook object and opening an Excel file using its file path
     $workbook = $ptr->New("Aspose.Cells.Workbook", array());
     $worksheets = $ptr->Get($workbook, "Worksheets", array());
     $sheetIndex = $ptr->Call($worksheets, "Add", array());
     $worksheet = $ptr->Get($worksheets, "Item", array($sheetIndex));
     $cells = $ptr->Get($worksheet, "Cells", array());
     $a1 = $ptr->Get($cells, "Item_3", array("A1"));
     $ptr->Call($a1, "PutValue", array(1));
     $a2 = $ptr->Get($cells, "Item_3", array("A2"));
     $ptr->Call($a2, "PutValue", array(2));
     $a3 = $ptr->Get($cells, "Item_3", array("A3"));
     $ptr->Call($a3, "PutValue", array(3));
     $a4 = $ptr->Get($cells, "Item_3", array("A4"));
     $ptr->Call($a3, "PutValue", array(3));
     $ptr->Call($workbook, "Save", array($dataDir . "/output.xls"));
     $ptr->Set($a4, "Formula", "=SUM(A1:A3)", array());
     $ptr->Call($workbook, "CalculateFormula", array());
     $value = $ptr->Get($a4, "Value", array());
     $stringVal = $ptr->Call($value, "ToString", array());
     print "Calculated Value: " . $stringVal . PHP_EOL;
     $ptr->Call($workbook, "Save", array($dataDir . "/output.xls"));
     print "Completed." . PHP_EOL;
 }
开发者ID:xiurui12345,项目名称:Aspose_Cells_NET,代码行数:31,代码来源:CalculatingFormulas.php

示例2: run

 public static function run($dataDir = null)
 {
     if (is_null($dataDir)) {
         die("Data Directory Undefined");
     }
     // Create Aspose.Cells Helper Object
     $ptr = new \COM('Aspose.Cells.Interop.InteropHelper');
     // Opening through Path
     // Creating a Workbook object and opening an Excel file using its file path
     $workbook = $ptr->New("Aspose.Cells.Workbook", array($dataDir . '/book1.xls'));
     $worksheets = $ptr->Get($workbook, "Worksheets", array());
     $worksheet_index = $ptr->Call($worksheets, "Add_2", array());
     $worksheet = $ptr->Get($worksheets, "Item", array($worksheet_index));
     $ptr->Set($worksheet, "Name", "My Worksheet", array());
     $ptr->Call($workbook, "Save", array($dataDir . "/output.xls"));
     print "Completed." . PHP_EOL;
 }
开发者ID:xiurui12345,项目名称:Aspose_Cells_NET,代码行数:17,代码来源:AddWorksheetsToExistingExcelFile.php

示例3: run

 public static function run($dataDir = null)
 {
     if (is_null($dataDir)) {
         die("Data Directory Undefined");
     }
     // Create Aspose.Cells Helper Object
     $ptr = new \COM('Aspose.Cells.Interop.InteropHelper');
     // Opening through Path
     // Creating a Workbook object and opening an Excel file using its file path
     $workbook = $ptr->New("Aspose.Cells.Workbook", array($dataDir . '/MyTestBook1.xls'));
     $worksheets = $ptr->Get($workbook, "Worksheets", array());
     $sheet = $ptr->Get($worksheets, 'Item', array(0));
     $imgOptions = $ptr->New("Aspose.Cells.Rendering.ImageOrPrintOptions", array());
     $imageFormat = new \DOTNET('mscorlib', 'System.Drawing.Imaging.ImageFormat');
     $ptr->Set($imgOptions, 'ImageFormat', $imageFormat->Jpeg, array());
     $ptr->Set($imgOptions, 'OnePagePerSheet', true, array());
     $sr = $ptr->New("Aspose.Cells.Rendering.SheetRender", array($sheet, $imgOptions));
     $bitmap = new \DOTNET("mscorlib", "System.Drawing.Bitmap");
     $bitmap->Save($dataDir . "./SheetImage.jpg");
     print "Conversion to Image(s) completed!" . PHP_EOL;
 }
开发者ID:xiurui12345,项目名称:Aspose_Cells_NET,代码行数:21,代码来源:WorksheetToImage.php

示例4: run

 public static function run($dataDir = null)
 {
     if (is_null($dataDir)) {
         die("Data Directory Undefined");
     }
     // Create Aspose.Cells Helper Object
     $ptr = new \COM('Aspose.Cells.Interop.InteropHelper');
     // Opening through Path
     // Creating a Workbook object and opening an Excel file using its file path
     $workbook = $ptr->New("Aspose.Cells.Workbook", array($dataDir . '/Book1.xls'));
     $worksheets = $ptr->Get($workbook, "Worksheets", array());
     print "Workbook opened using path successfully!" . PHP_EOL;
 }
开发者ID:xiurui12345,项目名称:Aspose_Cells_NET,代码行数:13,代码来源:OpeningFiles.php

示例5: run

 public static function run($dataDir = null)
 {
     if (is_null($dataDir)) {
         die("Data Directory Undefined");
     }
     // Create Aspose.Cells Helper Object
     $ptr = new \COM('Aspose.Cells.Interop.InteropHelper');
     // Opening through Path
     // Creating a Workbook object and opening an Excel file using its file path
     $workbook = $ptr->New("Aspose.Cells.Workbook", array($dataDir . '/Book1.xls'));
     $XOR = $ptr->New("Aspose.Cells.EncryptionType.XOR", array());
     $crypt = $ptr->New("Aspose.Cells.EncryptionType.StrongCryptographicProvider", array());
     $ptr->Call($workbook, "SetEncryptionOptions", array($XOR, 40));
     $ptr->Call($workbook, "SetEncryptionOptions", array($crypt, 128));
     $settings = $ptr->Get($workbook, "Settings", array());
     $ptr->Set($settings, "Password", "1234", array());
     $ptr->Call($workbook, "Save", array($dataDir . "/encryptedoutBook1.xls"));
     print "Completed." . PHP_EOL;
 }
开发者ID:xiurui12345,项目名称:Aspose_Cells_NET,代码行数:19,代码来源:EncryptingFiles.php

示例6: windows_create_kloxo_service

function windows_create_kloxo_service()
{
    $OWN_PROCESS = 16;
    $NOT_INTERACTIVE = False;
    $NORMAL_ERROR_CONTROL = 2;
    $objWMIService = new COM("winmgmts:{impersonationLevel=impersonate}//./root/cimv2");
    $objService = $objWMIService->Get("Win32_BaseService");
    $user = new COM("WinNT://./lxlabs");
    $user->setPassword("lxlabspass");
    $user->setInfo();
    try {
        //$objService->Create("LxaServer" ,"LxaServer" ,'"C:/Program Files/lxlabs/ext/lxhttpd/Apache2/bin/Apache.exe" -k runservice -f "c:/Program Files/lxlabs/ext/lxhttpd/Apache2/conf/httpd.conf"', $OWN_PROCESS, $NORMAL_ERROR_CONTROL, "Automatic",  $NOT_INTERACTIVE, ".\lxlabs", "lxlabspass");
        $objService->Create("LxaMultiplexer", "LxaMultiplexer", '"C:/Program Files/lxlabs/ext/Multiplexer/MultiplexerSrvc.exe"', $OWN_PROCESS, $NORMAL_ERROR_CONTROL, "Automatic", $NOT_INTERACTIVE, ".\\LocalSystem", "");
    } catch (Exception $e) {
        print " ERROR: {$e}";
    }
    $colListOfServices = $objWMIService->ExecQuery("Select * from Win32_Service Where Name = 'LxaMultiplexer' or Name = 'LxaServer'");
    foreach ($colListOfServices as $objService) {
        $objService->StartService();
        print "\n Done \n";
    }
}
开发者ID:soar-team,项目名称:kloxo,代码行数:22,代码来源:windowsproglib.php

示例7: COM

<?php

include "lib/include.php";
$objWMIService = new COM("winmgmts:{impersonationLevel=impersonate}//./root/cimv2");
$objService = $objWMIService->Get("Win32_BaseService");
$colListOfServices = $objWMIService->ExecQuery("Select * from Win32_Service Where Name = 'LxaMultiplexer' or Name = 'LxaServer'");
foreach ($colListOfServices as $objService) {
    if ($argv[1] == 'stop') {
        $objService->StopService();
    }
    if ($argv[1] == 'start') {
        $objService->StartService();
    }
    if ($argv[1] == 'restart') {
        $objService->StopService();
        sleep(1);
        $objService->StartService();
    }
    print "\n Done \n";
}
开发者ID:soar-team,项目名称:kloxo,代码行数:20,代码来源:restartMultiplexer.php

示例8: os_restart_program

function os_restart_program()
{
    return;
    $objWMIService = new COM("winmgmts:{impersonationLevel=impersonate}//./root/cimv2");
    $objService = $objWMIService->Get("Win32_BaseService");
    $colListOfServices = $objWMIService->ExecQuery("Select * from Win32_Service Where Name = 'LxaMultiplexer' or Name = 'LxaServer'");
    foreach ($colListOfServices as $objService) {
        $objService->stopService();
        sleep(1);
        $objService->startService();
        print "\n Done \n";
    }
}
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:13,代码来源:windowslib.php

示例9: createMxRecord

 function createMxRecord($strDomain, $recordType, $recordValue, $MXpref)
 {
     $strContainer = $strDomain;
     $strOwner = $strDomain;
     $intTTL = $this->main->ttl;
     $intPreference = $MXpref;
     $intRecordClass = '1';
     $strMailExchanger = $recordValue;
     $strServer = "";
     $objWMIService = new COM("winmgmts://./root/MicrosoftDNS");
     $colItems = $objWMIService->ExecQuery("Select * from MicrosoftDNS_MXType where domainname='{$strDomain}' and preference='{$MXpref}'");
     if (mycount($colItems) > 0) {
         print "Already Exists/n";
         throw new lxException("mx_rec_already_exist", '');
     }
     $objItem = $objWMIService->Get("MicrosoftDNS_MXType");
     $errResult = $objItem->CreateInstanceFromPropertyData($strServer, $strContainer, $strOwner, $intReCordClass, $intTTL, $intPreference, $strMailExchanger);
 }
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:18,代码来源:dns__msdnslib.php


注:本文中的COM::Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。