网络学院标题关闭所有内容预览 | 展开所有内容预览
-
VB Listview导出到CSV文件函数
[内容预览]
0 | 2011-12-08
示例: Call ListviewToCSV(Listview1,"C:\123.csv") 最后一个参数Encabezado决定是是否导出表头。默认是导出的。 Public Function ListviewToCSV(ListView As ListView, sFile As String, Optional Encabezado...
[阅读全文]
-
VB WinInet Post/Get 提交模块代码
[内容预览]
63 | 2011-10-09
'调用示例Debug.Print WinInetGet("http://127.0.0.1/index.html")Debug.Print WinInetPost("http://127.0.0.1/index.php", "UserName=admin")'上面两个函数都是返回byte数组,如果出现乱码可以通过以下这个函数安指...
[阅读全文]
-
VB Wininet实现文件下载与网页获取函数
[内容预览]
47 | 2011-09-11
'下面是在Form窗体中的调用示例代码。 '写入文件Private Sub WriteFile(ByteArray() As Byte, Path As String) Open Path For Binary As #1 Put #1, , ByteArray() Close #1End Sub'网页编码转换Public Function B...
[阅读全文]
-
VB URL编码函数(GB2312)
[内容预览]
32 | 2011-07-30
编码后是GB2312格式URL,对字母、数字、- , . / 字符不编码。你也可以根据自己的需要修改。 以前发过一个UTF-8格式的URL编码函数( http://www.newxing.com/Tech/Program/VisualBasic/URLEncode_717.html ) Publ...
[阅读全文]
-
VB 使用SendMessage枚举文件与目录
[内容预览]
41 | 2011-07-07
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As LongPrivate Const LB_DIR = &H18DPrivate C...
[阅读全文]
-
VB UTF-8 URL编码函数
[内容预览]
119 | 2011-05-09
VB UTF-8 URL编码函数: Public Function UTF8_URLEncoding(szInput) Dim wch, uch, szRet Dim x Dim nAsc, nAsc2, nAsc3 If szInput = "" Then UTF8_URLEncoding = szInput Exit Function End If For x = 1 To Len...
[阅读全文]
-
VB 窗体实现文件拖拽获取路径方法
[内容预览]
123 | 2011-04-25
VB 窗体实现文件拖拽,只需要将窗体的OLEDropMode 属性设置为1即可。同样在ListBox、TreeView、ListView……等控件都提供这个属性设置的。然后通过OLEDragDrop事件来获取拖放的文件路径即可。 Private Sub Form...
[阅读全文]
-
VB 获取execScript返回值另类方法
[内容预览]
169 | 2011-04-24
方法就是先执行JS函数,然后将返回的结果存放在一个变量里面,再通过Document.Script来获取该变量的值。 <script type="text/javascript"> var ReturnValue function test(){ ReturnValue="测试" }</script> Cal...
[阅读全文]
-
[图文] VB PopupMenu弹出右键菜单小例子
[内容预览]
170 | 2011-04-10
附件下载.rar 很基础的知识,大鸟飞过。 Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)'利用PopupMenu方法 If Button And vbRightButton Then PopupMenu wj '弹...
[阅读全文]
-
VB 使某个窗口获取焦点的API函数
[内容预览]
204 | 2011-03-16
使用 SetForegroundWindow API即可实现。声明如下: Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long hwnd 参数是窗口的句柄。 返回值:如果窗口设入了前台,返回值...
[阅读全文]
-
VB 通过SendMessage 发送消息获取文本框的内容
[内容预览]
251 | 2011-03-16
VB 通过SendMessage 发送消息获取文本框的数据的函数: Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As An...
[阅读全文]
-
VB 设置CapsLock、ScrollLock、NumLock键状态
[内容预览]
117 | 2011-03-13
VB 设置CapsLock、ScrollLock、NumLock 按键状态: Option ExplicitPrivate Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)P...
[阅读全文]
-
VB 文件编码互换模块(支持 Ansi,UTF-8,Unicode(little endian),Unicode...
[内容预览]
487 | 2011-03-08
VB 文件编码互换模块,支持对Ansi,UTF-8,Unicode(little endian),Unicode big endian编码之间进行转换。 Option ExplicitPrivate Declare Function MultiByteToWideChar Lib "kernel32.dll" (ByVal CodePage As...
[阅读全文]
-
VB 移动Combobox某项的位置
[内容预览]
50 | 2011-03-07
VB 移动Combox某项的位置: 'cbojob当前选择向下移一位Private Sub cmdPostpone_Click() Dim strItem As String Dim lngIndex As Long 'copy原来的数据,包括列数据 strItem = Me.cboJob & ";" & Me.cboJob...
[阅读全文]
-
VB Listview控件列宽度自动调整
[内容预览]
217 | 2011-03-07
VB 实现自动调整Listview列表控件的列宽度: Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long...
[阅读全文]
-
VB 按指定编码格式写入文本文件
[内容预览]
213 | 2011-02-27
VB 按指定编码格式写入文本文件,默认GB2312编码。 Private Sub SaveFile(FilePath As String, strText As String, Optional Charset As String = "GB2312") Dim Obj As Object Set Obj = CreateObject("ADODB.Str...
[阅读全文]
-
VB 纯代码实现判断文件目录是否存在
[内容预览]
144 | 2011-02-26
VB 纯代码实现判断文件目录是否存在,没有用到API 、组件等,纯VB 内置函数实现判断某个文件夹是否存在。 Public Function DirectoryExists(ByVal Directory As String) As Boolean If InStrRev(Directory, "\") <> ...
[阅读全文]
-
VB 通过文件路径获取该文件所在目录的函数
[内容预览]
133 | 2011-02-26
VB 通过文件路径获取该文件所在目录的函数: Private Function getDirectory(FilePath As String) getDirectory = Mid(FilePath, 1, InStrRev(FilePath, "\"))End Function
[阅读全文]
-
[图文] VB 通过SendMessage发送消息添加ComboBox列表项值
[内容预览]
294 | 2011-02-23
VB 通过SendMessage发送消息添加ComboBox列表项值,也就是实现了Combo中的AddItem方法。 Private Const CB_ADDSTRING = &H143Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByV...
[阅读全文]
-
VB 通过窗体句柄获取标题函数
[内容预览]
121 | 2011-02-22
VB 通过窗体句柄获取标题函数,通过已知的句柄获取该句柄的标题。 Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal Hwnd As Long, ByVal lpString As String, ByVal cch As L...
[阅读全文]
-
VB 实现UTF-8 与GB2312互转
[内容预览]
248 | 2011-02-22
VB 利用ADODB.Stream来实现UTF-8 与GB2312互转。 '* ** *'* 模块名称:modCharset.bas'* 模块功能:GB2312与UTF8相互转换函数'* 作者:lyserver'* ** *Option Explicit'- --- -' 函数说明:GB2312转换为UTF8'- ...
[阅读全文]
-
VB 判断图片文件的类型格式
[内容预览]
105 | 2011-02-18
VB 通过二进制方式来判断图片的格式,下面只对 JPG 、GIF、PNG、BMP、ICO 几个常用的图片格式做了判断。 Public Function GetImageType(ByteArray() As Byte) As String If ByteArray(0) = &HFF And ByteArray(...
[阅读全文]
-
VB 十六进制字符串转2进制数组
[内容预览]
170 | 2011-02-16
VB 16进制字符串转二进制数组函数: Private Function HexToBytes(strHex As String) As Byte() strHex = Trim$(strHex) Dim TempData() As String Dim Data() As Byte, i As Long TempData = Split(strHex, " ") ...
[阅读全文]
-
VB 二进制数组转换成16进制字符串函数
[内容预览]
215 | 2011-02-16
VB 二进制Byte()数组转换成十六进制字符串函数: Private Function BytesToHex(bytB() As Byte) As String Dim strTmp As String, i As Long For i = 1 To UBound(bytB) strTmp = strTmp & " " & Hex(bytB...
[阅读全文]
-
VB 判断是否文本文件
[内容预览]
73 | 2011-02-15
Option Explicit'*'**作 者:新兴网络'**原 文:http://www.newxing.com/Tech/Program/VisualBasic/666.html'**如果需要转载,请保留作者信息谢谢'*Public Function IsTextFile(Bytes() As Byte) As Boolean Dim i ...
[阅读全文]
-
VB ListBox 添加不重复的值
[内容预览]
201 | 2011-02-15
VB ListBox 添加不重复的值,当列表中已经存在该值即不再添加。 Private Function AddList(List As ListBox, Str As String) As Boolean Dim I As Long For I = 0 To List.ListCount-1 If List.List(I) = Str Then...
[阅读全文]
-
VB 判断当前是否运行在VB6 IDE环境中
[内容预览]
62 | 2011-02-09
Private Function IsIDE() As Boolean Static bInIDE As Boolean bInIDE = Not bInIDE If bInIDE Then Debug.Assert IsIDE() Or True IsIDE = Not bInIDE End IfEnd FunctionPrivate Sub Form_Load() MsgBox IsIDEEn...
[阅读全文]
-
[图文] VB 将HTML格式文本写入RichTextBox控件中
[内容预览]
314 | 2011-02-05
VB 在RichTextBox控件中使用HTML代码来设置文字样式,目前只支持 <font>、<br>、<b> 标签,可通过font标签的Color、Size、Face属性来设置文本的字体颜色、字体大小以及文字字体。 加强版:http://www.newxing.com/C...
[阅读全文]
-
将网页颜色值转换为VB颜色值的函数
[内容预览]
100 | 2011-02-04
将网页颜色值转换为VB颜色值的函数,同时支持颜色名称转换。 Public Function WebColorToVBColor(WebColor As String) As Long Dim strhex As String, R As Double, G As Double, B As Double If InStr(WebColor, ...
[阅读全文]
-
挺不错的一个 VB数组排序模块
[内容预览]
188 | 2011-02-04
VB数组排序模块,使用的是快速排序法,支持 Variant、Double、Long、String……等多种数据类型数组排序。 Option ExplicitPrivate Sub QuicksortInt(list() As Integer, ByVal min As Integer, ByVal max As Intege...
[阅读全文]
