?? 1.txt
字號:
Public strImgN As String
Public BImg() As Byte
Public Sub LoadImage()
On Error Resume Next
Dim ImgS As Long
Dim OS As Long
Dim TmpPic As String
Const conCS = 100
TmpPic = App.Path & "\tmpPic.bmp"
If Len(Dir(TmpPic)) > 0 Then
Kill TmpPic
End If
Dim F As Integer
F = FreeFile
Open App.Path & "\tmpPic.bmp" For Binary As #F '以二進制文件打開tmpPic.bmp空文件
ImgS = adomembership.Fields("picblob").ActualSize
Do While OS < ImgS
'從數據庫中獲取圖片二進制文件數據塊 大小為conCS
BImg() = adomembership("picblob").GetChunk(conCS)
Put #F, , BImg
OS = OS + conCS
Loop
'構造mpPic.bmp文件完成
Close #F
frmMembership.imgpic.Picture = LoadPicture(App.Path & "\tmpPic.bmp")
Kill App.Path & "\tmpPic.bmp"
End Sub
'code for image
Public Sub Image()
On Error Resume Next
Dim IntNum As Integer
IntNum = FreeFile
Open strImgN For Binary As #IntNum
ReDim BImg(FileLen(strImgN))
Get #IntNum, , BImg
Close #1
End Sub
adomembership.Fields("picblob").AppendChunk BImg
If False Then
'先建立空文件=======================================
Open "c:\test1.txt" For Append Access Write As #1
Print #1, Text1.Text
Close #1
'再讀---------------
Dim tmpStr As String
Dim tmpVar As Variant
Dim i As Integer
Text2.Text = ""
Open "c:\test1.txt" For Input Access Read As #1
i = 1
Do Until EOF(1) '判斷是否到了文件末尾:ValBool=EOF(filenumber)
tmpVar = Input(1, #1)
tmpStr = tmpStr + tmpVar
i = i + 1
Loop
Text2.Text = tmpStr
Command2.Caption = "讀出" + CStr(LOF(1)) '返回一個文件的大小
Close #1
'==========================================
'按行讀====================================
Open (Common1.FileName) For Input As #1
Do While Not EOF(1)
Line Input #1, Intext
Text2.Text = Text2.Text & Intext
Loop
Close #1
'=============================================
'按行寫=====================================
Dim STR As String
Open (App.Path & "\Setup.ini") For Output As #1
Print #1, "[DataBase]"
STR = "DBName='" & Text1.Text & "'"
Print #1, STR
STR = "UserName='" & Text3.Text & "'"
Print #1, STR
STR = "UserPwd='" & Text4.Text & "'"
Print #1, STR
STR = "ODBCName='" & Text2.Text & "'"
Print #1, STR
STR = "DBServer='" & Trim(Text5.Text) & "'"
Print #1, STR
Close #1
'=======================================
'按規律讀出
Open (App.Path & "\Setup.ini") For Input As #1
Line Input #1, Intext
Line Input #1, Intext '讀入數據庫名稱
db_str = MID(Intext, 9, Len(Intext) - 9)
Line Input #1, Intext
UserName = MID(Intext, 11, Len(Intext) - 11) '讀入登錄用戶名信息
Line Input #1, Intext
UserPwd = MID(Intext, 10, Len(Intext) - 10) '讀入用戶密碼信息
Line Input #1, Intext
ODBC_str = MID(Intext, 11, Len(Intext) - 11) '讀入數據源名稱
Text2.Text = ODBC_str
Close #1
GetUserName StrName, 255
Text1.Text = Trim(db_str)
Text3.Text = Trim(UserName)
Text4.Text = Trim(UserPwd)
Text5.Text = Trim(Computer_str)
'[Database]
'DBName='Data_jdgl'
'UserName='sa'
'UserPwd='232323'
'ODBCName='jdgl'
'DBServer='NIXIUHUI'
'==========================================================
' '添加登錄系統日志========
Dim c
Open (App.Path & "\系統日志.ini") For Input As #1
Do While Not EOF(1)
Line Input #1, Intext
TStr = TStr + Intext + Chr(13) + Chr(10)
Loop
Close #1
TStr = TStr + " Admin " + Format(Now, "yyyy-mm-dd hh:mm:ss") + " " + "登錄系統" + Chr(13) + Chr(10)
Open (App.Path & "\系統日志.ini") For Output As #1
Print #1, TStr
Close #1
TStr = ""
'======================================================
StatusBar1.Panels(4).Text = Format(Now, " hh點mm分ss秒")
End If
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -