我有一個使用了一個名爲spreadsheetgear.dllC#到PowerShell的
DLL在Visual Studio C#程序我做了以下內容:
Reference the spreadsheetgear.dll
SpreadsheetGear.IWorkbook workbook1 =
SpreadsheetGear.Factory.GetWorkbook("C:\text.xls");
這工作正常,在C#和Visual Studio
在PowerShell中,我創建了類似的邏輯是:
Add-Type -Path "C:\spreadsheetgear.dll"
$workbook1 = New-Object SpreadsheetGear.Factory.GetWorkbook("c:\test.xls")
但是PowerShell的給了我一個犯錯或說.... 新對象:找不到類型[SpreadsheetGear.Factory.GetWorkbook]:確保包含此類型的程序集已加載。
我在做什麼錯...請協助。
謝謝。
澄清 - 這是powershell 1或2? [Reflection.Assembly] :: LoadFile需要返回1. – sclarson 2011-04-19 20:29:38