עבור לתוכן

קריאת קבצים גדולים בVB

Featured Replies

פורסם

שלום לכולם.

אני כותב אפקליצייה קטנה שמטרתה לערוך את הFirmWare של הטלפון שלי בנוחות יחסית.

אני מנסה לפתוח קובץ ששוקל 66 מגה והמחשב פשוט נתקע לי.

אותו קובץ נפתח תוך חצי דקה בערך בWINHEX.

איך אני גורם לאפליקצייה שלי לפתוח את הקובץ בלי לתקוע את המחשב??

ניסיתי ב-2 השיטות הבאות:

[left]Private Sub cmdopen_Click()

Dim filelocation As String

CommonDialog1.ShowOpen
filelocation = CommonDialog1.FileName
r1.LoadFile filelocation, rtfText
Image1.Picture = LoadPicture(filelocation)
End Sub

Private Sub Command1_Click()
CommonDialog1.ShowOpen

filelocation = CommonDialog1.FileName
Dim file_name As String
Dim file_length As Long
Dim fnum As Integer
Dim bytes() As Byte
Dim txt As String
Dim i As Integer

file_name = filelocation
file_length = FileLen(file_name)

fnum = FreeFile
ReDim bytes(1 To file_length)

Open file_name For Binary As #fnum
Get #fnum, 1, bytes
Close fnum

' Display the results.
For i = 1 To file_length
txt = txt & Format$(bytes(i)) & vbCrLf
Next i
txtValues.Text = txt
End Sub[/left]

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים