CodeDom黑匣子

时间:2013-03-17 02:00:06

标签: vb.net vb.net-2010

VB.Net代码。我想隐藏用编译代码打开的黑匣子......怎么样?

每当我编译它时它会打开一个cmd shell ...

    Public Shared Function CompileVBCode(sourceFile As String, exeFile As String) As Boolean
    Dim vbprovider As VBCodeProvider = New VBCodeProvider()
    Dim cp As New CompilerParameters()
    cp.ReferencedAssemblies.Add("System.dll")
    cp.GenerateInMemory = False
    cp.GenerateExecutable = True
    cp.OutputAssembly = exeFile
    Dim cr As CompilerResults = vbprovider.CompileAssemblyFromSource(cp, sourceFile)

1 个答案:

答案 0 :(得分:0)

cp.CompilerOptions += "/t:winexe"