几年前我编写了一个 vb 程序,现在当我再次开始使用 vb 时,我遇到了一个“障碍”。带有顺序文件。我正在尝试使用文件对话框将文件加载到 vb 程序中。
注意:我正在使用结构
Dim FileDialog as new openFileDialog
Dim MyStream as Stream = nothing
Dim FileLocation as string 'this is to save the file location
if( FileDialog.ShowDialog() = DialogResults.OK)Then
FS = new FileStream(FileLocation, FileMode.open, fileaccess.Read)
BF = new BinaryFromatter
While FS.Position < FS.Length
Dim temp as unit
...'Please note that this is where the file reads the structures data.It is to much code to write in.
当我运行程序时,我可以创建一个文件并将其与数据一起保存,然后我可以使用对话框加载它,问题是当我再次运行程序并尝试加载它时。它只是不会运行文件或加载它(记住我用这个程序创建了文件并保存了)
我怎样才能让它工作?