473,397 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

View > Source

hey everybody,

I have written a great browser but it is missing a feature (quite a lot
actually, but forget about them for now). that feature just so happens to be
the View > Source function. for those of you who don't what i mean, it is
when you click a button in the view menu that says Page source (in Netscape)
and source (in Internet Explorer). if you click it, notepad opens. in that
window is the html for the page.

anyway, does anyone know how to show the source?

--
Alvo von Cossel I of Germany
Nov 17 '05 #1
8 2222
The easiest way for you to do it would be to make sure you’ve got a copy of
the source saved to some temporary location and launch a copy of notepad via
the Process class with either the /A or /W argument followed by the filename
of this temp file.

If you wanted to stay completely within your code, a new form with a large,
multi-line textbox too would do the job, however for my money I would
probably go with notepad just because of it’s simplicity.

Just for note, with regards to the above arguments, /A opens the file as an
ANSI file while /w opens it as Unicode.

Brendan
"Alvo von Cossel I" wrote:
hey everybody,

I have written a great browser but it is missing a feature (quite a lot
actually, but forget about them for now). that feature just so happens to be
the View > Source function. for those of you who don't what i mean, it is
when you click a button in the view menu that says Page source (in Netscape)
and source (in Internet Explorer). if you click it, notepad opens. in that
window is the html for the page.

anyway, does anyone know how to show the source?

--
Alvo von Cossel I of Germany

Nov 17 '05 #2
hi,

thanks brendan. i want to do it with the new form because it would seem more
simple and it would take up less storage space on your HDD. would you know
how to do that?

--
Alvo von Cossel I of Germany
"Brendan Grant" wrote:
The easiest way for you to do it would be to make sure you’ve got a copy of
the source saved to some temporary location and launch a copy of notepad via
the Process class with either the /A or /W argument followed by the filename
of this temp file.

If you wanted to stay completely within your code, a new form with a large,
multi-line textbox too would do the job, however for my money I would
probably go with notepad just because of it’s simplicity.

Just for note, with regards to the above arguments, /A opens the file as an
ANSI file while /w opens it as Unicode.

Brendan
"Alvo von Cossel I" wrote:
hey everybody,

I have written a great browser but it is missing a feature (quite a lot
actually, but forget about them for now). that feature just so happens to be
the View > Source function. for those of you who don't what i mean, it is
when you click a button in the view menu that says Page source (in Netscape)
and source (in Internet Explorer). if you click it, notepad opens. in that
window is the html for the page.

anyway, does anyone know how to show the source?

--
Alvo von Cossel I of Germany

Nov 17 '05 #3
To do it all within your C# app I would do it as follows:

1. Create a new Windows Form.
2. Add a textbox to the form and name it sourceTextBox
3. Set Multiline to True and Dock to fill on sourceTextBox
4. Add the following property to the code of the Form:
public string Source
{
set
{
sourceTextBox.Text = value;
}
}

5. When in your code you wish to view the source, simply create a new
instance of your newly created source viewing form, set the Source property
on it equal to the string containing the source, and call the Show() or
ShowDialog() method on it to display it.

Simple enough?

Brendan
"Alvo von Cossel I" wrote:
hi,

thanks brendan. i want to do it with the new form because it would seem more
simple and it would take up less storage space on your HDD. would you know
how to do that?

--
Alvo von Cossel I of Germany
"Brendan Grant" wrote:
The easiest way for you to do it would be to make sure you’ve got a copy of
the source saved to some temporary location and launch a copy of notepad via
the Process class with either the /A or /W argument followed by the filename
of this temp file.

If you wanted to stay completely within your code, a new form with a large,
multi-line textbox too would do the job, however for my money I would
probably go with notepad just because of it’s simplicity.

Just for note, with regards to the above arguments, /A opens the file as an
ANSI file while /w opens it as Unicode.

Brendan
"Alvo von Cossel I" wrote:
hey everybody,

I have written a great browser but it is missing a feature (quite a lot
actually, but forget about them for now). that feature just so happens to be
the View > Source function. for those of you who don't what i mean, it is
when you click a button in the view menu that says Page source (in Netscape)
and source (in Internet Explorer). if you click it, notepad opens. in that
window is the html for the page.

anyway, does anyone know how to show the source?

--
Alvo von Cossel I of Germany

Nov 17 '05 #4
hi,

i get a message saying: 'Source': member names cannot be the same as their
enclosing type

what does it mean?

by the way, here is the line with the error:

public string Source() // <<Error here
{
set;
{
sourceTextBox.Text = value;
}
}
--
Alvo von Cossel I of Germany
"Brendan Grant" wrote:
To do it all within your C# app I would do it as follows:

1. Create a new Windows Form.
2. Add a textbox to the form and name it sourceTextBox
3. Set Multiline to True and Dock to fill on sourceTextBox
4. Add the following property to the code of the Form:
public string Source
{
set
{
sourceTextBox.Text = value;
}
}

5. When in your code you wish to view the source, simply create a new
instance of your newly created source viewing form, set the Source property
on it equal to the string containing the source, and call the Show() or
ShowDialog() method on it to display it.

Simple enough?

Brendan
"Alvo von Cossel I" wrote:
hi,

thanks brendan. i want to do it with the new form because it would seem more
simple and it would take up less storage space on your HDD. would you know
how to do that?

--
Alvo von Cossel I of Germany
"Brendan Grant" wrote:
The easiest way for you to do it would be to make sure you’ve got a copy of
the source saved to some temporary location and launch a copy of notepad via
the Process class with either the /A or /W argument followed by the filename
of this temp file.

If you wanted to stay completely within your code, a new form with a large,
multi-line textbox too would do the job, however for my money I would
probably go with notepad just because of it’s simplicity.

Just for note, with regards to the above arguments, /A opens the file as an
ANSI file while /w opens it as Unicode.

Brendan
"Alvo von Cossel I" wrote:

> hey everybody,
>
> I have written a great browser but it is missing a feature (quite a lot
> actually, but forget about them for now). that feature just so happens to be
> the View > Source function. for those of you who don't what i mean, it is
> when you click a button in the view menu that says Page source (in Netscape)
> and source (in Internet Explorer). if you click it, notepad opens. in that
> window is the html for the page.
>
> anyway, does anyone know how to show the source?
>
> --
> Alvo von Cossel I of Germany

Nov 17 '05 #5
remove the parenthesis... should just be "public string Source" as it's
a property, not a method.

"Alvo von Cossel I" <Al************@discussions.microsoft.com> wrote in
message news:C7**********************************@microsof t.com...
hi,

i get a message saying: 'Source': member names cannot be the same as their
enclosing type

what does it mean?

by the way, here is the line with the error:

public string Source() // <<Error here
{
set;
{
sourceTextBox.Text = value;
}
}
--
Alvo von Cossel I of Germany
"Brendan Grant" wrote:
To do it all within your C# app I would do it as follows:

1. Create a new Windows Form.
2. Add a textbox to the form and name it sourceTextBox
3. Set Multiline to True and Dock to fill on sourceTextBox
4. Add the following property to the code of the Form:
public string Source
{
set
{
sourceTextBox.Text = value;
}
}

5. When in your code you wish to view the source, simply create a new
instance of your newly created source viewing form, set the Source
property
on it equal to the string containing the source, and call the Show() or
ShowDialog() method on it to display it.

Simple enough?

Brendan
"Alvo von Cossel I" wrote:
> hi,
>
> thanks brendan. i want to do it with the new form because it would seem
> more
> simple and it would take up less storage space on your HDD. would you
> know
> how to do that?
>
> --
> Alvo von Cossel I of Germany
>
>
> "Brendan Grant" wrote:
>
> > The easiest way for you to do it would be to make sure you've got a
> > copy of
> > the source saved to some temporary location and launch a copy of
> > notepad via
> > the Process class with either the /A or /W argument followed by the
> > filename
> > of this temp file.
> >
> > If you wanted to stay completely within your code, a new form with a
> > large,
> > multi-line textbox too would do the job, however for my money I would
> > probably go with notepad just because of it's simplicity.
> >
> > Just for note, with regards to the above arguments, /A opens the file
> > as an
> > ANSI file while /w opens it as Unicode.
> >
> > Brendan
> >
> >
> > "Alvo von Cossel I" wrote:
> >
> > > hey everybody,
> > >
> > > I have written a great browser but it is missing a feature (quite a
> > > lot
> > > actually, but forget about them for now). that feature just so
> > > happens to be
> > > the View > Source function. for those of you who don't what i mean,
> > > it is
> > > when you click a button in the view menu that says Page source (in
> > > Netscape)
> > > and source (in Internet Explorer). if you click it, notepad opens.
> > > in that
> > > window is the html for the page.
> > >
> > > anyway, does anyone know how to show the source?
> > >
> > > --
> > > Alvo von Cossel I of Germany

Nov 17 '05 #6
hi,

thanks but now i get an error on one of the curly brackets instead of the
Source:

public string Source
{
set;
{ // <<error here. It says: a get or set accessor expected
sourceTextBox.Text = value;
}
}

cheers,

--
Alvo von Cossel I of Germany
"Dan Bass" wrote:
remove the parenthesis... should just be "public string Source" as it's
a property, not a method.

"Alvo von Cossel I" <Al************@discussions.microsoft.com> wrote in
message news:C7**********************************@microsof t.com...
hi,

i get a message saying: 'Source': member names cannot be the same as their
enclosing type

what does it mean?

by the way, here is the line with the error:

public string Source() // <<Error here
{
set;
{
sourceTextBox.Text = value;
}
}
--
Alvo von Cossel I of Germany
"Brendan Grant" wrote:
To do it all within your C# app I would do it as follows:

1. Create a new Windows Form.
2. Add a textbox to the form and name it sourceTextBox
3. Set Multiline to True and Dock to fill on sourceTextBox
4. Add the following property to the code of the Form:
public string Source
{
set
{
sourceTextBox.Text = value;
}
}

5. When in your code you wish to view the source, simply create a new
instance of your newly created source viewing form, set the Source
property
on it equal to the string containing the source, and call the Show() or
ShowDialog() method on it to display it.

Simple enough?

Brendan
"Alvo von Cossel I" wrote:

> hi,
>
> thanks brendan. i want to do it with the new form because it would seem
> more
> simple and it would take up less storage space on your HDD. would you
> know
> how to do that?
>
> --
> Alvo von Cossel I of Germany
>
>
> "Brendan Grant" wrote:
>
> > The easiest way for you to do it would be to make sure you've got a
> > copy of
> > the source saved to some temporary location and launch a copy of
> > notepad via
> > the Process class with either the /A or /W argument followed by the
> > filename
> > of this temp file.
> >
> > If you wanted to stay completely within your code, a new form with a
> > large,
> > multi-line textbox too would do the job, however for my money I would
> > probably go with notepad just because of it's simplicity.
> >
> > Just for note, with regards to the above arguments, /A opens the file
> > as an
> > ANSI file while /w opens it as Unicode.
> >
> > Brendan
> >
> >
> > "Alvo von Cossel I" wrote:
> >
> > > hey everybody,
> > >
> > > I have written a great browser but it is missing a feature (quite a
> > > lot
> > > actually, but forget about them for now). that feature just so
> > > happens to be
> > > the View > Source function. for those of you who don't what i mean,
> > > it is
> > > when you click a button in the view menu that says Page source (in
> > > Netscape)
> > > and source (in Internet Explorer). if you click it, notepad opens.
> > > in that
> > > window is the html for the page.
> > >
> > > anyway, does anyone know how to show the source?
> > >
> > > --
> > > Alvo von Cossel I of Germany


Nov 17 '05 #7
In message <BF**********************************@microsoft.co m>, Alvo
von Cossel I <Al************@discussions.microsoft.com> writes
hey everybody,

I have written a great browser but it is missing a feature (quite a lot
actually, but forget about them for now). that feature just so happens to be
the View > Source function. for those of you who don't what i mean, it is
when you click a button in the view menu that says Page source (in Netscape)
and source (in Internet Explorer). if you click it, notepad opens. in that
window is the html for the page.


What do you mean when you say you've "written" a browser; do you mean
that you've written one from the ground up (in which case only you know
how to get to the raw html) or that you've embedded the IE browser in
your application?

If it's the latter, then something like:

mshtml.HTMLDocumentClass doc =
(mshtml.HTMLDocumentClass)this.axWebBrowser1.Docum ent;
MessageBox.Show(doc.documentElement.innerHTML);

should do what you want.
--
Steve Walker
Nov 17 '05 #8
"Alvo von Cossel I" <Al************@discussions.microsoft.com> wrote in
message news:75**********************************@microsof t.com...
hi,

thanks but now i get an error on one of the curly brackets instead of the
Source:

public string Source
{
set;
{ // <<error here. It says: a get or set accessor expected

<snip>

Lose the semicolon after the set
Nov 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
4
by: hetnet | last post by:
Hello, How can i disabled a menuitem like " View => Source"??? -- Met vriendelijke groet, Rob van Westrop
6
by: shr | last post by:
Is there any way by which I can display the source of a html page using the 'view:source' command, in an iframe?? I tried using this viewer.location = "view-source:" + viewer.location.href; where...
15
by: Michael Hill | last post by:
I saw a site that looked pretty good, but I could view the source. 2 questions: 1) how can I do the same for my site 2) any way to get around this? Mike
29
by: lori3laz | last post by:
How do you disable the right click>view source option on web pages so people can't view your coding and copy it? What's the html I need to include in my website to utilize this feature? Thank...
2
by: sierrachang | last post by:
Why would one not want to sort records in a form using Form Properties > Datasheet View > Sort Ascending? It's the fastest way, isn't it?
6
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
5
by: Nathan Sokalski | last post by:
My Web.config file contains the following section to register some of my UserControls: <pages> <controls> <add tagPrefix="NATE" tagName="Banner" src="~/Banner.ascx"/> <add tagPrefix="NATE"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.