slt

j'ai une problème dans la fonction FileGet() :



Le code est :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
Option Strict Off
Option Explicit On
Friend Class Form1
    Inherits System.Windows.Forms.Form
    Dim fno As Short
    Dim SizeOfFile As String
    Dim ByteArray() As Byte
    Dim Bytemodif() As Byte
    Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
 
        dlgMainOpen.Filter = "(*.*)|*.*"
        dlgMainOpen.ShowDialog()
        If dlgMainOpen.FileName <> vbNullString Then
            Text1.Text = dlgMainOpen.FileName
        Else
            Exit Sub
        End If
 
 
        fno = FreeFile()
        FileOpen(fno, Text1.Text, OpenMode.Binary)
        SizeOfFile = CStr(LOF(fno))
 
        ReDim ByteArray(CInt(SizeOfFile))
 
        ReDim Bytemodif(CInt(SizeOfFile))
 
        FileGet(fno, ByteArray)
        'Bytemodif = Copy(ByteArray)
        Bytemodif = ByteArray.Clone()
        FileClose(fno)
 
        Text4.Text = SizeOfFile
        Text6.Text = "Fichier sélectionné."
    End Sub
Merci Beaucoup