征途LINUX服务端脚本技术,腾讯征途手游脚本 辅助基本语法

■调用存储过程,可以认为是一个三层结构显示一些配置信息,包括了服务器的域名064a4b164f1b09a8f5dfd3afd4fdaa15.png有时为了一个特技、一句代码甚至一个变量要反复调试运行几十遍,也未必能通过,真恨不得一枪崩了VB

regEx.IgnoreCase=True'设置是否区分字符大小写VB程序实现此功能有很多文章探讨过,但大都着眼于Windows的注册表

Exec:自定义按钮执行的目标,可以为执行程序或超文本链接

2)在Form1中添加一命令按钮,缺省名为Command1

我本来想获取aaa.com页面的内容,可是aaa.com跳转到bbb.com了下载后使用但是,使用Replace函数,可以巧妙地解决这个问题

Function ReadExcel( myXlsFile, mySheet, my1stCell, myLastCell, blnHeader )

' Function : ReadExcel

' Version : 2.00

' This function reads data from an Excel sheet without using MS-Office

'

' Arguments:

' myXlsFile [string] The path and file name of the Excel file

' mySheet [string] The name of the worksheet used (e.g. "Sheet1")

' my1stCell [string] The index of the first cell to be read (e.g. "A1")

' myLastCell [string] The index of the last cell to be read (e.g. "D100")

' blnHeader [boolean] True if the first row in the sheet is a header

'

' Returns:

' The values read from the Excel sheet are returned in a two-dimensional

' array; the first dimension holds the columns, the second dimension holds

' the rows read from the Excel sheet.

'

' Written by Rob van der Woude

'

Dim arrData( ), i, j

Dim objExcel, objRS

Dim strHeader, strRange

Const adOpenForwardOnly=0

Const adOpenKeyset=1

Const adOpenDynamic=2

Const adOpenStatic=3

' Define header parameter string for Excel object

If blnHeader Then

strHeader="HDR=YES;"

Else

strHeader="HDR=NO;"

End If

' Open the object for the Excel file

Set objExcel=CreateObject( "ADODB.Connection" )

' IMEX=1 includes cell content of any format; tip by Thomas Willig

objExcel.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _

myXlsFile & ";Extended Properties=""Excel 8.0;IMEX=1;" & _

strHeader & """"

' Open a recordset object for the sheet and range

Set objRS=CreateObject( "ADODB.Recordset" )

strRange=mySheet & "$" & my1stCell & ":" & myLastCell

objRS.Open "Select * from [" & strRange & "]", objExcel, adOpenStatic

' Read the data from the Excel sheet

i=0

Do Until objRS.EOF

' Stop reading when an empty row is encountered in the Excel sheet

If IsNull( objRS.Fields(0).Value ) Or Trim( objRS.Fields(0).Value )="" Then Exit Do

' Add a new row to the output array

ReDim Preserve arrData( objRS.Fields.Count - 1, i )

' Copy the Excel sheet's row values to the array "row"

' IsNull test credits: Adriaan Westra

For j=0 To objRS.Fields.Count - 1

If IsNull( objRS.Fields(j).Value ) Then

arrData( j, i )=""

Else

arrData( j, i )=Trim( objRS.Fields(j).Value )

End If

Next

' Move to the next row

objRS.MoveNext

' Increment the array "row" number

i=i + 1

Loop

' Close the file and release the objects

objRS.Close

objExcel.Close

Set objRS=Nothing

Set objExcel=Nothing

' Return the results

ReadExcel=arrData

End Function

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值