Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

Make money selling software. Check this out here

Hosted clickbank mall. Check this out here




   Misc

   Amazon

   Links

    


Read a file using VB.net
 

 

Reading a file using VB.net

 

 

<%@ Import Namespace="System.IO" %>
<script language="vb" runat="server">
sub Page_Load(sender as Object, e as EventArgs)
'Open the sampletext.txt file . Note this is in the same directory as the script
Dim testfile as String = Server.MapPath("sampletext.txt")
'Create a streamreader class
Dim objStreamReader as StreamReader
'open the file
objStreamReader = File.OpenText(testfile)
'Read the file storing it in the readfile string
Dim readfile as String = objStreamReader.ReadToEnd()
'Place the string into a web control
lblTextFile.Text = readfile
'close the StreamReader class
objStreamReader.Close()
end sub
</script>

<asp:label runat="server" id="lblTextFile" />


 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
DNS information(C Sharp)
free disk space using WMI(VBScript)
Open copy disk dialog(VB)
Check for a crawler(ASP.net)
displays a list of My Computer locations(VBScript)
Area of circle(C)
extract a zip file to a folder(PHP)
round form example(VB)

    




Copyright © 2003 by programmershelp.co.uk