Source function for browser

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,

i have written a browser from scratch and i want to have a function where
you can view the HTML source with notepad (or a built in text editior that i
can create).

how do i doe this? help me please!
 
Hi...

I am amazed that you can write a browser but are unsure how to do this
8-).

See the Win32 call CreateProcess() or ShellExecute().

John
 
hi,

why are you amazed? it isnt really that difficult. my browser has less
functions than internet explorer but to make up for it, you can search MSN,
Google, Yahoo!, Netscape, Ask Jeeves and Lycos using a really simple built in
search function.
 
Alvo von Cossel I said:
why are you amazed? it isnt really that difficult. my browser has less
functions than internet explorer but to make up for it, you can search MSN,
Google, Yahoo!, Netscape, Ask Jeeves and Lycos using a really simple built in
search function.

You must admit that it's odd to hear that you're capable of writing a
web browser (presumably in C#), but you don't understand the syntax for
declaring a property (as per another thread). That's very basic stuff,
whereas writing a web browser (really writing one, not just wrapping
IE) is far from simple.
 
hi again,

well, i wrote it from scratch. if i didn't and just wrapped IE, then i
wouldn't have asked the question. anyway, it really wasn't that difficult to
write it! you should try
 
well, i wrote it from scratch. if i didn't and just wrapped IE, then i
wouldn't have asked the question. anyway, it really wasn't that difficult to
write it! you should try

Now I'm fascinated. Care to give us an overview of the approach you
took? How long did it take you to write?
 
Alvo von Cossel I said:
well, i wrote it from scratch. if i didn't and just wrapped IE, then i
wouldn't have asked the question. anyway, it really wasn't that difficult to
write it! you should try

I have better things to do - but did you really write a whole browser
without using a single property? That doesn't sound like it's terribly
OO.
 
hi steve,

well, the if you search msdn for browser or something, you will find some
tips for making a browser. mine was similar to the example but i edited it so
much that there is 100 times less similarity.

the search function is really simple. make a combobox, a webbrowser and a
button saying search msn.

whilst you are searching msn, type this code into the button's click event:

webbrowser1.url = "http://search.msn.com/results.aspx?FORM=MSCOM2&q=" +
combobox1.text;

it's really that simple. i also aadded some features like a Back buttron and
stuff like that. the code is something like webbrowser1.navigate.back; or
somthing similar

it's my pleasure to answer that question.
 
hi,

no, WebBrowser1 is just a standard WebBrowser control. does it work now?

by the way the code wasn't copyrighted so feel free to copy it completely
 
Alvo said:
hi,

no, WebBrowser1 is just a standard WebBrowser control. does it work now?

Ah, I see, I thought it might be.

What John Skeet and I were asking about was whether you had written the
entire browser, rendering engine and all. Hence the incredulous "you
wrote an entire browser from scratch????" response, because writing a
fully-featured one from windows sockets to rendered content would be an
enormous challenge. Imagine parsing the HTML stream and then drawing the
document on a blank canvas. Imagine trying to keep it up to date with
new standards. Imagine trying to parse and render sensibly all the
broken HTML out there. Imagine writing a javascript runtime engine. A
cool hobby project for someone with a *lot* of time on their hands, but
frankly, I'd rather be fishing :o)

What you've done sounds like a good use of the control, though. Have you
had a go at navigating the document object model from C#? If not, try
this, and have a look at the properties and methods on doc:

mshtml.IHTMLDocument2 doc =
(mshtml.IHTMLDocument2)this.WebBrowser1.Document;
 
hi,

will do. i suppose it would be quite difficult to write a browser entirely
from scratch. anyway, i can navigate with the webbrowser, if that's what you
meant. i have some code like

navigate.back();

or something like that. i haven't the time to check my code now.

see you around
 
Alvo said:
hi,

will do. i suppose it would be quite difficult to write a browser entirely
from scratch.

Difficult doesn't come into it. Horrendous sounds more like it! Every
time my mail/news client annoys me, I think "It wouldn't be that hard to
write my own", but it's all the little things I'd miss. Very hard to
cover everyone's needs.

I wouldn't like to guess how many people have worked on the client I
use, though. Very difficult to do better than them, however many bugs I
find. You strike me as a very keen programmer, though; I'm assuming
you're quite young, though I could easily be wrong. Have you thought
about getting involved in one of the open source community projects?
 
hi,

i am, in fact, 12 years old. i wouldnt mind taking part in a community
project but i dont think it exists in merry old england (yes, i live in
englan, despite what my signature is: "alvo von cossel i of germany". i just
am german).

cheers,
 
Alvo von Cossel I said:
i am, in fact, 12 years old. i wouldnt mind taking part in a community
project but i dont think it exists in merry old england (yes, i live in
englan, despite what my signature is: "alvo von cossel i of germany". i just
am german).

They're not physically local community projects - there are community
open source projects all over the internet. Look at SourceForge
(www.sf.net) for a good starting point.

I'd be careful about saying you've written a browser "from scratch"
when introducing yourself though :)
 
Alvo said:
hi,

i am, in fact, 12 years old. i wouldnt mind taking part in a community
project but i dont think it exists in merry old england (yes, i live in
englan, despite what my signature is: "alvo von cossel i of germany". i just
am german).

You're doing very well, then. Stick at it!
 

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

Similar Threads


Back
Top