Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is GETFILE() in VB.NET?
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Miscellaneous
Thread ID:
01189717
Message ID:
01189735
Views:
8
>What is the VB.NET equivalent of the Visual FoxPro Function GETFILE()?

I use these commands to open and read a text file
Imports System
Imports System.IO
Imports System.Text

...

Dim temp As UTF8Encoding = New UTF8Encoding(True)
Dim fs As FileStream
Dim openFileDialog1 As New OpenFileDialog
openFileDialog1.Filter = "Archivos de texto (*.txt)|*.txt|Todos los archivos|*.*"

If openFileDialog1.ShowDialog() = DialogResult.OK Then
   archivo = openFileDialog1.FileName
   If File.Exists(openFileDialog1.FileName) Then
       Me.lblProcesando.Visible = True
       fs = File.Open(archivo, FileMode.Open, FileAccess.Read)
       Do While fs.Read(linea, 0, linea.Length) > 0
           sLinea = temp.GetString(linea)
           txtJob = sLinea.Substring(0, 8)
           txtStockCode = sLinea.Substring(8, 30)
           txtWarehouse = sLinea.Substring(38, 2)
           txtQtyReqd = sLinea.Substring(40, 14)
       Loop
       fs.Close()
       ....
       ....
    end if
end if
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform