<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>精评技经论坛 - VB 精品代码</title>
    <link>http://hgplus.net/bbs/forum.php?mod=forumdisplay&amp;fid=44</link>
    <description>Latest 20 threads of VB 精品代码</description>
    <copyright>Copyright(C) 精评技经论坛</copyright>
    <generator>Discuz! Board by Comsenz Inc.</generator>
    <lastBuildDate>Wed, 20 May 2026 06:10:06 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>http://hgplus.net/bbs/static/image/common/logo_88_31.gif</url>
      <title>精评技经论坛</title>
      <link>http://hgplus.net/bbs/</link>
    </image>
    <item>
      <title>VB操作Win10移动热点</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=136</link>
      <description><![CDATA[VB操作Win10移动热点
    1.新建文本文档，然后将文件名改为“Hotspot.ps1”；    2.鼠标点“Hotspot.ps1”文档，右键选编辑，系Win10系统将默认调用“PowerShell.exe”打开当前文件；    3.将以下内容复制粘贴到打开的文档中，保存退出；
$connectionProfile = [Window ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Sat, 08 Aug 2020 05:33:58 +0000</pubDate>
    </item>
    <item>
      <title>VB判断Excel中某表是否存在</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=128</link>
      <description><![CDATA[VB判断Excel中某表是否存在
    Set xlApp = CreateObject(\&quot;Excel.Application\&quot;)
    If TypeName(xlApp.Evaluate(\&quot;表名\&quot; &amp; \&quot;!A1\&quot;)) = \&quot;Error\&quot; Then Msgbox \&quot;名称为[表名]的表不存在
    If TypeName(xlApp.Evaluate(\&quot;表名\&quot; &amp; \&quot;!A1\&quot;)) = \&quot;Range\&quot; Then Msgbox \&quot;名称为[表 ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Mon, 23 Apr 2018 03:00:01 +0000</pubDate>
    </item>
    <item>
      <title>VB判断64位Excel</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=125</link>
      <description><![CDATA[VB判断64位Excel
    Set xlApp = CreateObject(\&quot;Excel.Application\&quot;)
    If Split(xlApp.ProductCode, \&quot;-\&quot;)(3) = \&quot;1000\&quot; Then Msgbox \&quot;本机的Excel是64位\&quot; Else Msgbox \&quot;本机的Excel是32位\&quot;
    Set xlApp = Nothing
                                                ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Fri, 20 Apr 2018 08:12:54 +0000</pubDate>
    </item>
    <item>
      <title>VB向DOS窗口发送字符串命令</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=120</link>
      <description><![CDATA[VB向DOS窗口发送字符串命令
    作用：利用VB来实现需要在DOS窗口中输入多行命才能完成且无法用批处理来实现的工作。
    添加API函数：
    Private Declare Function FindWindow Lib \&quot;user32\&quot; Alias \&quot;FindWindowA\&quot; (ByVal lpClassName As String, ByVal lpWindowName  ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Mon, 26 Sep 2016 00:44:19 +0000</pubDate>
    </item>
    <item>
      <title>VB共享网络连接函数</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=117</link>
      <description><![CDATA[VB共享网络连接函数
    作用：通过VB，将指定网络连接(Wifi连接、连接Intetnet网卡的连接)共享，实现网络资源共享(Wifi共享上网、双网卡共享上网等)。

    用法：Call EnableDisableICS(连接名称1,连接名称2,False或Ture)，其中：连接名称1--拟共享的连接名称；连接名 ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Wed, 20 Jul 2016 06:43:48 +0000</pubDate>
    </item>
    <item>
      <title>32位进程如何读写64位注册表</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=115</link>
      <description><![CDATA[32位进程如何读写64位注册表
    众所周知，32位进程在64位系统中读/写注册表时，部分路径会发生自动转向。以读写系统自动登录用户名为例，原想读写 “[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon]” 中的DefaultUserName，结果实际读 ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Mon, 25 Apr 2016 06:03:42 +0000</pubDate>
    </item>
    <item>
      <title>VB 判断系统分区格式</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=114</link>
      <description><![CDATA[VB判断32/64位系统
    Sys_Disk = Environ(\&quot;HomeDrive\&quot;)          \'Environ(\&quot;HomeDrive\&quot;) 通常为\&quot;C:\&quot;，其他分区需手工输入(如：D:、E:、......等)

    Set ColFileSystemList = ObjWMIService.ExecQuery(\&quot;Select * From Win32_LogicalDisk\&quot;, \&quot;WQL\&quot;, &amp;H10 + &amp;H20)
     ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Mon, 25 Apr 2016 05:45:41 +0000</pubDate>
    </item>
    <item>
      <title>VB判断32/64位系统</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=113</link>
      <description><![CDATA[VB判断32/64位系统

    Set ColItems = GetObject(\&quot;winmgmts:\\\\.\\root\\cimv2\&quot;).ExecQuery(\&quot;Select * from Win32_ComputerSystem\&quot;, , 48)
    For Each objItem In ColItems
      DiskFileType = UCase(Split(objItem.SystemType, \&quot;-\&quot;)(0))]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Mon, 25 Apr 2016 05:36:08 +0000</pubDate>
    </item>
    <item>
      <title>64位VBA如何调用32位dll文件</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=112</link>
      <description><![CDATA[64位VBA如何调用32位dll文件

1.运行VB6，新建 ActiveX EXE，在Class1中输入以下代码，属性中的工程名称改为“Call32Dll”，最后编译为*.exe文件(本例为：Call32Dll.exe）

Public Function LoadDll(ProID As String) As Object

    Set LoadDll = CreateObject(ProID) ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Mon, 25 Apr 2016 05:22:01 +0000</pubDate>
    </item>
    <item>
      <title>32位进程如何访问64位系统的System32目录</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=110</link>
      <description><![CDATA[32位进程如何访问64位系统的System32目录
          64位操作系统为兼容32位程序运行，设有\&quot;C:\\Windows\\System32\&quot; 和 \&quot;C:\\Windows\\sysWOW64\&quot;两个系统文件目录；正常情况下，当某个32位的进程设计访问\&quot;C:\\Windows\\System32\&quot;目录(例如运行\&quot;System32\&quot;目录下的文件等)时，64 ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Mon, 27 Apr 2015 00:20:47 +0000</pubDate>
    </item>
    <item>
      <title>如何用Adodc控件代替Adodb操作数据库</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=107</link>
      <description><![CDATA[如何用Adodc控件代替Adodb操作数据库
            VB操作Access数据库最常见易用的方法是用Adodb，使用前只需引用“Microsoft ActiveX Data Objects x.x Library”即可，基本代码如下：

    Dim Conn As New ADODB.Connection
    Dim Rs As New ADODB.Recordset

     ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Mon, 24 Nov 2014 05:57:48 +0000</pubDate>
    </item>
    <item>
      <title>vb 获取本地连接地址信息</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=106</link>
      <description><![CDATA[VB 获取本地连接地址信息
          添加API函数：

Private Declare Function RegCreateKey Lib \&quot;advapi32.dll\&quot; Alias \&quot;RegCreateKeyA\&quot; (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegEnumKey Lib \&quot;advapi3 ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Tue, 22 Jul 2014 01:20:54 +0000</pubDate>
    </item>
    <item>
      <title>VB 后台打开网页</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=105</link>
      <description><![CDATA[VB 后台打开网页
    要打开网页又不希望出面页面窗口，恐怕更多的人会优先想到借助WebBrowser控件来变相实现，但其实这是一种大马拉小车的做法。

    后台打开网页方法一：

    Dim IE As Object
    Private Sub Form_Load()
      Set IE = CreateObject(\&quot;Internet ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Wed, 16 Jul 2014 06:14:24 +0000</pubDate>
    </item>
    <item>
      <title>VB捕获自身进程用户名</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=104</link>
      <description><![CDATA[VB捕获自身进程用户名

    申明API函数：

    Private Declare Function GetUserName Lib \&quot;advapi32.dll\&quot; Alias \&quot;GetUserNameA\&quot; (ByVal lpBuffer As String, nSize As Long) As Long


    主代码：

    Dim UserNameStr As String * 255
    GetUserName UserNameSt ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Fri, 30 May 2014 09:03:12 +0000</pubDate>
    </item>
    <item>
      <title>如何解决Win7系统服务进程无法打开Excel文件之系统Bug</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=101</link>
      <description><![CDATA[如何解决Win7系统服务进程无法打开Excel文件之系统Bug

    
    Win7系统的非系统服务进程是可以通过 Set xlApp = CreateObject(\&quot;Excel.Application\&quot;) 及 xlApp.Workbooks.Open FileName:=完整文件名 打开Excel文件的，但同样的语句在Win7的系统服务(SYSTEM)进程中是无 ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Thu, 08 May 2014 08:13:09 +0000</pubDate>
    </item>
    <item>
      <title>如何让VB程序在Win7中默认以管理员身份运行</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=100</link>
      <description><![CDATA[如何让VB程序在Win7中默认以管理员身份运行

    
    工程 → 工程1属性 → 生成 → 类型:文件描述，写入值: update 或 setup 或 install → 确定，编译。

    Win7操作系统会自动检测文件名是否包含Setup/Install/Update，如果是即默认以管理员身份运行。



        ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Thu, 08 May 2014 07:43:06 +0000</pubDate>
    </item>
    <item>
      <title>VB上传文件到PHP空间函数</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=99</link>
      <description><![CDATA[VB上传文件到PHP空间函数

    
    VB上传文件到PHP空间的函数，本人亲自调试和完善，适用任意字符(包括中文及任意特殊字符)命名的文件。

    函数调用方法： ResponseText = UploadFile(FullFileName, UploadUrl)，其中FullFileName--要上传的本地文件全名(含路径),  ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Tue, 22 Apr 2014 07:58:41 +0000</pubDate>
    </item>
    <item>
      <title>VB 捕获目标分区格式</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=98</link>
      <description><![CDATA[VB捕获目标分区格式

    Set ObjWMIService = GetObject(\&quot;winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2\&quot;)
    Set ColFileSystemList = ObjWMIService.ExecQuery(\&quot;Select * From Win32_LogicalDisk\&quot;, \&quot;WQL\&quot;, &amp;H10 + &amp;H20) 
    For Each ObjDisk In Col]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Fri, 11 Apr 2014 07:59:10 +0000</pubDate>
    </item>
    <item>
      <title>VB 捕获目标进程的父进程路径</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=97</link>
      <description><![CDATA[VB捕获目标进程的父进程路径

申明API函数：

    Private Declare Function OpenProcess Lib \&quot;kernel32\&quot; (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long  
    Private Declare Function EnumProcessModules Lib  ...]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Fri, 11 Apr 2014 07:35:10 +0000</pubDate>
    </item>
    <item>
      <title>VB 捕获目标进程用户名</title>
      <link>http://hgplus.net/bbs/forum.php?mod=viewthread&amp;tid=96</link>
      <description><![CDATA[VB捕获目标进程用户名

    Set ObjWMIService = GetObject(\&quot;winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2\&quot;)
    Set ColProcessList = ObjWMIService.ExecQuery(\&quot;Select * from Win32_Process Where Name =\&quot; &amp; \&quot;\'\&quot; &amp; 目标进程名 &amp; \&quot;\'\&quot;)
    For Each Obj]]></description>
      <category>VB 精品代码</category>
      <author>Zhy</author>
      <pubDate>Fri, 11 Apr 2014 07:28:13 +0000</pubDate>
    </item>
  </channel>
</rss>