看了没有:http://www.csdn.net/expert/topic/550/550567.xml?temp=.7191278
解决方案 »
- 如何使用ShowWindow函数循环激活多个程序窗口,会的进来帮一下,谢谢
- Vb获得鼠标坐标并自动加载窗体
- 如何获得RichTextBox中一个OLE对象的坐标?
- 关于打印的一点小问题,请教高手.
- 怎么用VB实现IIS重启,停止,编写成DLL用ASP调用
- recordset的filter属性难解,快来救我
- 如何获得打印机状态?
- DataGrid OnMouseUp事件的问题(绑定Adodc)
- 各位大侠,小弟在工作中遇到了难题求大家帮忙
- 请问各位高手,在动态加载菜单时如何指定某个菜单是另一个菜单的下一级菜单?
- 為什么ActiveReports在2000下面不能注冊呢?還有其它注冊方法嗎,謝謝了!
- 我想在vb里面加入sql语句来实现查询功能???
====================================================================
Type=Exe
Form=FrmZHexView.frm
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\WINDOWS\SYSTEM\stdole2.tlb#OLE Automation
Object={3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0; RICHTX32.OCX
Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; COMDLG32.OCX
IconForm="FrmZHexView"
Startup="FrmZHexView"
ExeName32="ZHexView.exe"
Command32=""
Name="HexView"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="910"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
FrmZHexView.frm
====================================================================
VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form FrmZHexView
Caption = "ZHexView"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
LockControls = -1 'True
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin MSComDlg.CommonDialog CDlg1
Left = 2100
Top = 1350
_ExtentX = 847
_ExtentY = 847
_Version = 393216
CancelError = -1 'True
End
Begin RichTextLib.RichTextBox RText1
Height = 1245
Left = 0
TabIndex = 2
Top = 330
Width = 2115
_ExtentX = 3731
_ExtentY = 2196
_Version = 393217
HideSelection = 0 'False
ScrollBars = 3
DisableNoScroll = -1 'True
RightMargin = 1e7
TextRTF = $"FrmZHexView.frx":0000
End
Begin VB.TextBox TxtFile
Height = 285
Left = 570
TabIndex = 1
Text = "Text1"
ToolTipText = "文件名"
Top = 0
Width = 4035
End
Begin VB.Label Lbl1
AutoSize = -1 'True
Caption = "打开:"
Height = 180
Left = 30
TabIndex = 0
Top = 30
Width = 540
End
End
Attribute VB_Name = "FrmZHexView"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Const MeText = "ZHexView"Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Declare Function timeGetTime Lib "winmm.dll" () As LongPrivate Sub Form_Load()
'Dim S1 As String, S2 As String * 3
'
'S1 = Space$(3)
'S2 = "03 "
'Call CopyMemory(ByVal StrPtr(S1), ByVal StrPtr(S2), 6)
'
'Debug.Print S1
CDlg1.Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly
CDlg1.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*"
End SubPrivate Sub Form_Resize()
If Me.WindowState = 1 Then Exit Sub
On Error Resume Next
TxtFile.Width = Me.ScaleWidth - TxtFile.Left
RText1.Width = Me.ScaleWidth
RText1.Height = Me.ScaleHeight - RText1.Top
On Error GoTo 0
End SubPrivate Sub Lbl1_Click()
'
End SubPrivate Sub Lbl1_DblClick()
On Error GoTo ErrOpen
CDlg1.ShowOpen
TxtFile.Text = CDlg1.FileName
TxtFile_KeyPress vbKeyReturn
On Error GoTo 0
Exit Sub
ErrOpen:
On Error GoTo 0
End SubPrivate Sub TxtFile_Change()
'
End SubPrivate Sub TxtFile_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
LoadHex TxtFile.Text
End If
End SubPrivate Sub LoadHex(FileStr As String)
Dim LoadBytes() As Byte
Dim FileNum As Integer
Dim FileSize As Long
Dim ArrayMax As Long
Dim AllStr As String
Dim TempStr As String
Dim TempPtr As Long
Dim I As Long, J As Long
Dim MaxI As Long
Dim Offset As Long
Dim StrOff As Long
Dim TimeLng As Long
FileNum = FreeFile
On Error GoTo ErrLoad
Open TxtFile.Text For Binary Access Read Lock Write As #FileNum
On Error GoTo 0
Screen.MousePointer = 13
Me.Caption = MeText + " 处理中……"
DoEvents
TimeLng = timeGetTime
FileSize = LOF(FileNum)
If FileSize <= 0 Then RText1.Text = "": Exit Sub
ArrayMax = FileSize - 1
ReDim LoadBytes(0 To ArrayMax)
Get #FileNum, , LoadBytes
Close #FileNum
MaxI = (ArrayMax + &HF) \ &H10 - 1
AllStr = Space(MaxI * 60 + IIf((ArrayMax And &HF) = &HF, 0, 10 + (ArrayMax And &HF) * 3))
TempPtr = StrPtr(AllStr)
For I = 0 To MaxI
StrOff = I * 60 * 2
TempStr = Hex$(I * &H10)
TempStr = String$(8 - Len(TempStr), "0") + TempStr + "h:"
Call CopyMemory(ByVal TempPtr + StrOff, ByVal StrPtr(TempStr), 20)
Offset = I * &H10
For J = 0 To &HF
If Offset + J > ArrayMax Then
Exit For
Else
TempStr = Hex$(LoadBytes(I * &H10 + J))
TempStr = " " + String$(2 - Len(TempStr), "0") + TempStr
Call CopyMemory(ByVal TempPtr + StrOff + (10 + J * 3) * 2, ByVal StrPtr(TempStr), 6)
End If
Next J
If J < &H10 Then
'
Else
TempStr = vbCrLf
Call CopyMemory(ByVal TempPtr + StrOff + 58 * 2, ByVal StrPtr(TempStr), 4)
End If
Next I
RText1.Text = AllStr
Screen.MousePointer = 0
TimeLng = timeGetTime - TimeLng
Me.Caption = MeText + " 处理时间:" + Format$(TimeLng, "##,###,###,##0") + "微秒"
Exit Sub
ErrLoad:
MsgBox Err.Description, vbCritical, Err.Number
End Sub
我马上就给分!