使用ILDASM.EXE工具!
写了两个小程序进行测试,一个使用C#语言,另外一个使用VB.NET语言。
d:\Mesh\study\VBAppDetect>dir /b
CSharpApp.exe
VBApp.exe
d:\Mesh\study\VBAppDetect>ildasm /tok /byt CSharpApp.exe /out=CSharpApp_manifest
.txt
d:\Mesh\study\VBAppDetect>type CSharpApp_manifest.txt | find /i "Microsoft.Visua
lBasic"
啥都没有,呵呵
d:\Mesh\study\VBAppDetect>ildasm /tok /byt VBApp.exe /out=VBApp_manifest.txt
d:\Mesh\study\VBAppDetect>type VBApp_manifest.txt | find /i "Microsoft.VisualBas
ic"
一大堆引用Microsoft.VisualBasic的方法、属性等,说明使用了VB.NET里面的东西了。
.assembly extern /*23000002*/ Microsoft.VisualBasic
extends [Microsoft.VisualBasic/*23000002*/]Microsoft.VisualBasic.Applicat
ionServices.WindowsFormsApplicationBase/*01000001*/
IL_0002: /* 28 | (0A)000002 */ call bool [Microsoft.VisualB
asic/*23000002*/]Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicati
onBase/*01000001*/::get_UseCompatibleTextRendering() /* 0A000002 */
IL_0018: /* 6F | (0A)000004 */ callvirt instance void [Microsoft.
VisualBasic/*23000002*/]Microsoft.VisualBasic.ApplicationServices.WindowsFormsAp
plicationBase/*01000001*/::Run(string[]) /* 0A000004 */
IL_0003: /* 28 | (0A)000005 */ call instance void [Microsoft.
VisualBasic/*23000002*/]Microsoft.VisualBasic.ApplicationServices.WindowsFormsAp
plicationBase/*01000001*/::.ctor(valuetype [Microsoft.VisualBasic/*23000002*/]Mi
crosoft.VisualBasic.ApplicationServices.AuthenticationMode/*01000016*/) /* 0A000
005 */
IL_0036: /* 6F | (0A)00000A */ callvirt instance void [Microsoft.
VisualBasic/*23000002*/]Microsoft.VisualBasic.ApplicationServices.WindowsFormsAp
plicationBase/*01000001*/::set_IsSingleInstance(bool) /* 0A00000A */
.
.
.
d:\Mesh\study\VBAppDetect>