为了与大家共同探讨和提高编程技术,在此我特别写了这篇技术文档。 本文档中将包含本程序的部分源代码以及注释说明,仅供高级用户参考。 其中部分代码来源于网络。 This technical document is made to share information about programming. It contains some parts of source code and comments of this programme. This document might be only suitable for experienced users. Some of the following code is from Internet. DirectX修复工具V1.0版的开发环境为:Microsoft Visual Studio 2008,开发语言: Visual Basic,.NET Framework版本:2.0,开发系统:Windows 7 旗舰版32位。 测试环境:Windows XP Home Edition(32 bit)、Windows XP Professional Edition(32 bit)、 Windows 7 旗舰版(32 bit)、Windows 7旗舰版(64 bit)、Windows 8 Pro(64 bit)、 Windows 8.1 Pre(64 bit)、Windows 10 pro (32 bit)、Windows 10 pro (64 bit)。 The environments for developing DirectX Repair V1.0 are shown as following: Microsoft Visual Studio 2008; Language: Visual Basic; .NET Framework: 2.0; Development OS: Windows 7 Ultimate 32-bit; Tested OS: Windows XP Home Edition (32 bit), Windows XP Professional Edition (32 bit), Windows 7 Ultimate (32 bit), Windows 7 Ultimate (64 bit), Windows 8 Pro (64 bit), Windows 8.1 Pre (64 bit), Windows 10 pro (32bit), Windows 10 pro (64 bit). --------------------------------------------------------------------------------------------------------------------- 程序中的部分代码: Some parts of source code: 1、检测操作系统版本。 1. To detect the version of the current OS. If Val(My.Computer.Info.OSVersion) < 6 Then 'XP、2000等没有.NET的操作系统 Else 'Vista、Win 7等自带.NET的操作系统 End If 2、防止程序重复运行。 2. To avoid re-running of the programme. Dim procName As String procName = System.Diagnostics.Process.GetCurrentProcess().ProcessName If (System.Diagnostics.Process.GetProcessesByName(procName)).GetUpperBound(0) > 0 Then MsgBox("程序已经在运行!", MsgBoxStyle.Critical) Me.Dispose() Exit Sub End If 3、获取操作系统名及版本号。 3. To acquire the system name and version information. My.Computer.Info.OSFullName & My.Computer.Info.OSVersion 4、调用系统的DirectX 诊断工具。 4. To call the DirectX Diagnosti