Hi Jesse,
This code should help you:
---------------------------CODE STARTS-----------------------------
For Each fil As IO.FileInfo In New IO.FileInfo("..\..\" & _
Application.ExecutablePath.Substring(Application.ExecutablePath.LastIndexOf("\"))) _
.Directory.GetFiles("*.vb")
Debug.WriteLine("FILE NAME :: " & fil.Name.ToString)
Dim ba() As Byte = New Byte(fil.Length) {}
'Read the contents of the file
fil.OpenRead().Read(ba, 0, fil.Length)
Debug.WriteLine(System.Text.ASCIIEncoding.Default.GetString(ba))
Debug.WriteLine("--------Manish------------------")
Next
-----------------------------CODE ENDS------------------------------
In the above code, the code starts with getting the root directory of the
Executable and parsing to the Bin and then Debug. And ultimately to the Root
of the project, which contains all the Source code files.
Then we are searching for all code files (.VB here, can be set to .CS in
case of C#); then reading the contents of this source code and printing it in
debug window.
The same data be be printed directly using the print document object, as
described in the following article:
http://www.vbdotnetheaven.com/UploadFile/mgold/PrintinginVBNET04202005015906AM/PrintinginVBNET.aspx
I hope this helps!
-Rajneesh
www.ComponentOne.com