发新话题
打印

来教你如何在vb里嵌入汇编!

来教你如何在vb里嵌入汇编!

  来教你如何在vb里嵌入汇编!

作者: wl3000wl 

本贴绝对值得你珍藏.

下面的例子完全用VB进行ASM编程的示例,本例获得CPU ID.

工程文件分为一个form1.frm 和一个模块module1.bas

----------------------form1.frm的源文件---------------------

VERSION 5.00
Begin VB.Form Form1
   Caption         =   "Form1"
   ClientHeight    =   1965
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3105
   LinkTopic       =   "Form1"
   ScaleHeight     =   1965
   ScaleWidth      =   3105
   StartUpPosition =   2  注释:Bildschirmmitte
   Begin VB.CommandButton Command1
      Caption         =   "Get CPU Name"
      Height          =   495
      Left            =   840
      TabIndex        =   0
      Top             =   315
      Width           =   1425
   End
   Begin VB.Label Label2
      Alignment       =   2  注释:Zentriert
      AutoSize        =   -1  注释:True
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   注释:False
         Italic          =   0   注释:False
         Strikethrough   =   0   注释:False
      EndProperty
      Height          =   240
      Left            =   1515
      TabIndex        =   2
      Top             =   1065
      Width           =   60
   End
   Begin VB.Label Label1
      Alignment       =   2  注释:Zentriert
      AutoSize        =   -1  注释:True
      BeginProperty Font
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   注释:False
         Italic          =   0   注释:False
         Strikethrough   =   0   注释:False
      EndProperty
      Height          =   285
      Left            =   1515
      TabIndex        =   1
      Top             =   1350
      Width           =   75
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

** Sub Command1_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)

    Label1 = ""
    Label2 = ""

End Sub

** Sub Command1_Click()
   
    Label1 = GetCpuName()

TOP

发新话题