Programmatically read code in the IDE

T

Tim Zych

I would like a way to scan the code in a vb.net project, say by creating a
vb.net utility to cycle through each line of code related to a particular
project and perform some analysis on it.

How do I program into the IDE? Did I ask that right? I need a way to
programmatically cycle through each line of code, for any code that's
related to a project.

thanks for any pointers.
 
R

RobinS

I would recommend that you write a program in VB that lets you specify a
top folder (like where the solution is), and then it cycles through from
that folder down looking for programs with a file extension of vb. Just
read them as if they were text files and look at the code that way.

Robin S.
 
L

Lloyd Sheen

I tend to agree with what was said but with some reservations.

I see more solutions with multiple folders (ie one for classes, one for
forms , one for usercontrols etc.) If you read the .vbproj file you will
find "Compile" nodes. Those are the source files you want. You will need to
get the "Include" node which holds the file name and the relative position
of the file.

This should give you a start.

Lloyd Sheen
 
T

Tim Zych

Thanks...that looks very promising.

Lloyd Sheen said:
I tend to agree with what was said but with some reservations.

I see more solutions with multiple folders (ie one for classes, one for
forms , one for usercontrols etc.) If you read the .vbproj file you will
find "Compile" nodes. Those are the source files you want. You will need
to get the "Include" node which holds the file name and the relative
position of the file.

This should give you a start.

Lloyd Sheen
 
T

Tim Zych

That's nice "out of the box" thinking. When I asked the question I was
thinking from "within" the IDE, but of course it makes sense to enumerate
the files in the directory. I was thinking of VBA where you can program to
the VBE and enumerate the lines of code without even having to get a handle
on the physical file.

Thanks.
 
L

Lloyd Sheen

Tim,

There are interfaces to program the IDE. I have not looked at that
since VS 2003 but I don't think it is much different. I tried a simple
example and it worked. At the time I did not find it easy to program but
then again I didn't spend alot of time on it.

If you go that route you can create your own toolbars , menus etc but
that would be your decsion.

LS
 
P

pfc_sadr

thanks guys; does this mean I actually get points for being helpful?

because I answered it correctly first??

THANK YOU, THANK YOU, THANK YOU

I miss the old ExpertsExchange ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top