Click here to Skip to main content
15,913,055 members
Home / Discussions / C#
   

C#

 
GeneralRe: Any query about northwind? Pin
Paul Conrad30-Dec-07 10:30
professionalPaul Conrad30-Dec-07 10:30 
GeneralRe: Any query about northwind? Pin
omegazafer30-Dec-07 10:57
omegazafer30-Dec-07 10:57 
Generali need your help ....am stuck Pin
netJP12L29-Dec-07 9:40
netJP12L29-Dec-07 9:40 
GeneralA little problem Pin
zeeShan anSari29-Dec-07 8:28
zeeShan anSari29-Dec-07 8:28 
AnswerRe: A little problem Pin
Guffa29-Dec-07 9:03
Guffa29-Dec-07 9:03 
GeneralRe: A little problem Pin
Rich Insley29-Dec-07 9:08
Rich Insley29-Dec-07 9:08 
QuestionGetting handle to browser window? Pin
cakewalkr729-Dec-07 3:30
cakewalkr729-Dec-07 3:30 
GeneralRe: Getting handle to browser window? Pin
Scott Dorman29-Dec-07 3:59
professionalScott Dorman29-Dec-07 3:59 
You would need to use P/Invoke interop calls to some of the Win32 API calls. I'm not sure which ones off-hand.

There is a potentially easier way, which would be to make use of the HttWebRequest object and the HTML parser[^] found in this article.

You would need code similar to this:
C#
HttpWebRequest webRequest = WebRequest.Create("http://www.codeproject.com") as HttpWebRequest;
string html = "";

if (webRequest != null)
{
    HttpWebResponse response = webRequest.GetResponse() as HttpWebResponse;
    if (response != null)
    {
         using (StreamReader reader = new StreamReader(response.GetResponseStream()))
         {
             html = reader.ReadToEnd();
         }
    }
}
 
if (html.Length > 0)
{
    HtmlParser parser = new HtmlParser();
    HtmlNodeCollection nodes = parser.Parse(html);
 
    // Find all of the table elements
    HtmlNodeCollection tables = nodes.FindByName("table");
 
    // Select the 6th table element
    HtmlNode table = tables[6];
}
As you can see, you can access the HTML in a similar method as you would XML, or you can load it directly into an XmlDocument (once you have selected a single HtmlNode element by using the following:
C#
XmlDocument xml = new XmlDocument();
xml.LoadXml(table.XHTML);
XmlNodeList tableRows = xml.SelectNodes("//tr");


Scott.

—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai

[Forum Guidelines] [Articles] [Blog]

GeneralException handling scenario Pin
beatles169229-Dec-07 1:23
beatles169229-Dec-07 1:23 
GeneralRe: Exception handling scenario Pin
Luc Pattyn29-Dec-07 1:58
sitebuilderLuc Pattyn29-Dec-07 1:58 
Generalmake binary file Pin
zafax_28-Dec-07 22:47
zafax_28-Dec-07 22:47 
GeneralRe: make binary file Pin
Colin Angus Mackay29-Dec-07 2:40
Colin Angus Mackay29-Dec-07 2:40 
GeneralRe: make binary file Pin
Scott Dorman29-Dec-07 3:35
professionalScott Dorman29-Dec-07 3:35 
GeneralRe: make binary file Pin
zafax_29-Dec-07 3:55
zafax_29-Dec-07 3:55 
GeneralRe: make binary file Pin
Scott Dorman29-Dec-07 4:01
professionalScott Dorman29-Dec-07 4:01 
GeneralRe: make binary file Pin
zafax_29-Dec-07 4:06
zafax_29-Dec-07 4:06 
GeneralGeneral problem with c sharp in VS2005 Pin
jgrogan28-Dec-07 21:25
jgrogan28-Dec-07 21:25 
GeneralRe: General problem with c sharp in VS2005 Pin
Luc Pattyn29-Dec-07 2:03
sitebuilderLuc Pattyn29-Dec-07 2:03 
GeneralRe: General problem with c sharp in VS2005 Pin
jgrogan29-Dec-07 2:19
jgrogan29-Dec-07 2:19 
GeneralRe: General problem with c sharp in VS2005 Pin
Luc Pattyn29-Dec-07 2:42
sitebuilderLuc Pattyn29-Dec-07 2:42 
GeneralRe: General problem with c sharp in VS2005 Pin
DaveyM6929-Dec-07 3:33
professionalDaveyM6929-Dec-07 3:33 
GeneralRe: General problem with c sharp in VS2005 Pin
Paul Conrad29-Dec-07 6:50
professionalPaul Conrad29-Dec-07 6:50 
QuestionHI Pin
Naresh12345678928-Dec-07 21:19
Naresh12345678928-Dec-07 21:19 
GeneralRe: HI Pin
michaelvdnest28-Dec-07 22:28
michaelvdnest28-Dec-07 22:28 
GeneralRe: HI Pin
michaelqog29-Dec-07 1:23
michaelqog29-Dec-07 1:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.