如何使用VB制作CAB压缩包。 引用 COM MakeCab 1.0 Type Library以及FSO对象模型。代码如下: Option Explicit Private Function IsFileExist(strPath As String) As Boolean Dim objFile As New FileSystemObject IsFileExist = objFile.FileExists(strPath) End Function Private Function GetFileName(strPath As String) As String Dim objFile As New FileSystemObject GetFileName = objFile.GetFileName(strPath) End Function Private Sub cmdCommand1_Click() Dim strPath As String, strFile As String strPath …
阅读全文 »WMI是一个强大的工具,一直有一个想法,就是把MS的一些东西用VB重写一下,最后聚合在一起,做一个实用的小工具。
文末有微软WMI页面。
[vb]
Private Sub cmdCommand1_Click()
Dim strComputerName As String
strComputerName = VBA.Environ("ComputerName")
Set wbemServices = G…
阅读全文 »写了一个IP转换函数,突然有个2想法,每个函数都必须要而强的话,那么算法函数就不必去检查传入数值的有效性。 这个工作应该由其他函数来做;可读性可以用注释表示,算法直接最简就可以了,例如下面的例子中的求和。 sum=p+p+p sum=p *3 Option Explicit Private Const TestIP01 As String = "211.136.108.171" Private Const TestIP02 As String = "3548933291" Public Function IPConvert(strIP As String, bMode As Byte) As String On Error GoTo hErr Dim bIndex As Byte, bTmp As Byte, dblSum As Double, strArr() As String, bArr(3) As …
阅读全文 »一个发送邮件的函数。 Option Explicit Private Declare Function ShellExecute _ Lib "shell32.dll" _ Alias "ShellExecuteA" (ByVal hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long Private Const SW_SHOW = 5 Public Function SendEmail(ByVal …
阅读全文 »Private Sub SendMails(lngTimes As Long, _ strFrom As String, _ strTo As String, _ strSubject As String, _ strContent As String) On Error Resume Next Dim lngIndex As Long Dim objMail As Object Server.ScriptTimeOut = 100000000 For lngIndex = 1 To lngTimes Set objMail = Server.CreateObject("CDONTS.NewMail") With …
阅读全文 »VB技巧若干,当复习了,贴上来备忘…高手自觉莫入。
阅读全文 »


