2013-03-17 81 views
0

VB.Net代碼。我想隱藏用編譯代碼打開的黑盒......怎麼樣?CodeDom黑盒子

它打開一個CMD殼每當我編譯它...

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) 

回答

0
cp.CompilerOptions += "/t:winexe" 
+0

你應該解釋一下,這是在做 – FDinoff 2013-05-15 15:02:08