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)