먼저 아래와 같이 c#을 작성하여 test.cs로 저장합니다.

public class testvbscriptcallabledll
{
	public string testmethod()
	{
		return "this is a string returned from .net compiled library";
	}
}


콘솔에서 해당 경로로 이동 아래와 같이 컴파일 합니다.
csc /nologo /t:library test.cs
그리고 어셈블리에 등록 합니다.
regasm /nologo /codebase test.dll

그리고 아래와 같이 test.vbs를 작성합니다.


Dim f

Set f = CreateObject("testvbscriptcallabledll")
msgbox f.testmethod
Set f = Nothing




test.vbs를 실행합니다. :)
2009/04/21 10:40 2009/04/21 10:40

Trackback Address :: https://youngsam.net/trackback/322