$source = @"
Imports System.Windows.Forms
Public Class Module1
Public Shared Sub Main()
Dim str As String = Application.StartupPath
System.Console.WriteLine("VB:" & str)
System.Console.ReadLine()
End Sub
End Class
"@
Add-Type `
-TypeDefinition $source `
-Language VisualBasic `
-ReferencedAssemblies System.Windows.Forms `
-OutputAssembly test1.exe `
-OutputType ConsoleApplication
Add-Type -TypeDefinition @"
using System.Windows.Forms;
public class Module2
{
public static void Main()
{
string str = Application.StartupPath;
System.Console.WriteLine("CS:"+str);
System.Console.ReadLine();
}
}
"@ -Language CSharp -ReferencedAssemblies System.Windows.Forms `
-OutputAssembly test2.exe -OutputType ConsoleApplication
"何かキーを押して下さい"
Read-Host
|