AssemblyInfo.vb は次のとおりです。
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("ClassLibrary1")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("ClassLibrary1")>
<Assembly: AssemblyCopyright("Copyright © 2012")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(True)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("bd484c72-e166-4480-a1fd-71ab12e09e25")>
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
そして、ここにクラスがあります:
Public Class Class1
Public Sub HelloWorld()
MsgBox("hello, world")
End Sub
End Class
DLL を regasm.exe に通してから、PHP からアクセスしようとしました。応答なし。
[編集: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\gacutil.exe を実行した後、厳密な名前のエラーが発生します。これについては現在取り組んでいます。今。]
PHP 5を介してアクセスできる.NET DLL(間違いでなければ「クラスライブラリ」の別の言葉)の最低限のHello worldサンプルを持っている人はいますか?そして、これまでのところ、この方法論で正しい道を進んでいますか?
これはどのように行われますか?助けてくれてありがとう。
これはPHPコードです:
<?php
$obj = new COM("ClassLibrary1.Class1");
$output=$obj->HelloWorld();
echo $output;
?>