Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6024873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:13:10+00:00 2026-05-23T04:13:10+00:00

This is my first stack overflow quesiton, so if i’m not posting correctly, or

  • 0

This is my first stack overflow quesiton, so if i’m not posting correctly, or not tagging right or whatever, please let me know.

For those curious, at the end of this question is a bit of background of why I want to do this.

I’m hoping someone has some ideas of how I can easily take a code file and then get an array of strings with each array element containing the contents of a single method from that code file.

What I want to do is be able to easily parse a .Net code file into it’s indivdial methods. Reading the file from disk is quite simple – parsing so that I have individual strings of each of the methods is what I’m looking for a better method of doing. The code files I will be passing through this are VB, but ideally I’d like to see this working with C# also. For the VB side, cycling through each line looking for the keywords of method declaration, then the next instance of the “end sub” and “end function” should work, but that won’t easily translate to C#. I also can’t get past this feeling there has to be a better way – possibly through reflection.

Now for the background: I have recently found that when windows forms are called with .ShowDialog, the resources aren’t cleaned up after your done with the form – you have to specifically dispose of it. This was discovered tracing down memory leaks in an application I work on. So what I need is to track down every instance of where showdialog is called and dispose is not called. A code search shows that I have over 300 instances of showdialog. That’s a bit tedious to go through each one, and find if the form is correctly disposed. If I have strings of all of the methods, I can just search for methods that include showdialog and not dispose. This will give me very targeted direction to get these things cleaned up, as well as give me a tool I can run regularly and find anyplace that may have introduced this back into the code.

Sorry for the long winded post here. Any and all suggestions are greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:13:11+00:00Added an answer on May 23, 2026 at 4:13 am

    Don’t do this. Look into tools like ReSharper from JetBrains or RefactorPro from DevExpress. These tools are designed to highlight code smells such as undisposed resources along with many many other things. Using one of these tools will be far more helpful to you and help you clean your code up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off - hello, this is my first Stack Overflow question so I'll try
This is my first question on Stack Overflow. Apologies in advance if I don't
problem euler #5 i found the solution but i don't know why this first
This is my first time using joomla. I don't know if I'm using the
My impression is that, when I hit Stack Overflow for the first time, it
First of all: this is not a homework assignment, it's for a hobby project
this is my first question to stackoverflow so here it goes... I use cruise
Greetings to all! This is my first question here on stackoverflow. I have a
This is my first post here and I wanted to get some input from
This is my first experience using the Zend Framework. I am attempting to follow

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.