Your question is very vague, from what language do you want to write a program to detect Flash? Do you want to have to right-click and download the source, or have a client side program, or a web based application where you type in the URL of the page?
If you want to right-click and download, you can use notepad.
If you want to write your own client side program, you can use anything from Java to C#, however, what you are asking to do is more or less write your own web browser without the front end interpreter (the part that decides how to render the HTML/data it receives). This will be slightly easier than writing a full blown browser, but it's still pretty advanced.
https://developer.mozilla.org/En
If you want to write a web based application, you have a slight bit easier of a time as you can use various techniques to pull the html data off a page from another page. You are essentially parsing another page. W3C has some open source validation software (the stuff that tells you if your site is W3 compliant or not) which may help you on your journey.
http://www.w3.org/Status
Altogether, you're facing a pretty tough road ahead, and I wish you luck :)