Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I recall a file class in vb?

Status
Not open for further replies.

erikkk

Programmer
Jun 25, 2001
12
0
0
IT
how can I recall a file .class in my visual basic document? Thanks for help!
 
".class" is usually a Java extension. Why would you want to read it/load it in Visual Basic?

If you want to read the Java source, then you can read it as an ordinary text file using the filesystem object (you have to set a reference to the Microsoft Scripting Runtime).
[tt]
Dim fso As Scripting.FileSystemObject
Dim ts As Scripting.TextStream
Dim sTemp As String

Set fso = New Scripting.FileSystemObject
Set ts = fso_OpenTextFile("C:\somefile.class", ForReading, False, TristateUseDefault)

While Not ts.AtEndOfStream
' Read a line from the file
sTemp = ts.ReadLine
' Then do something with it
Wend

ts.Close
Set ts = Nothing
Set fso = Nothing
[/tt]

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top