471,350 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

What's the difference?

I've got an application I'm converting from VB6 to C# 2005. I've
broken my problem down to this (Run on same machine seconds apart):

This works.

Dim dd As New DOMDocument
Dim pNodeList As IXMLDOMNodeList
Dim pNode As IXMLDOMNode

dd.async = False
dd.Load "http://rss.cnn.com/rss/cnn_topstories.rss"

Set pNodeList = dd.selectNodes("//item")
For Each pNode In pNodeList
Next pNode

This doesn't. I get a message that proxy authentication is required (I
didn't need it a second ago):

XmlDocument doc = new XmlDocument();
doc.Load(@"http://rss.cnn.com/rss/cnn_topstories.rss");
XmlNodeList rss = doc.SelectNodes("//item");
foreach (XmlNode r in rss)
{

}

What am I missing?

Thanks

Dec 21 '05 #1
5 1173
I was trying to find an example for you and came across this article. I hope
this helps:

http://groups.google.com/group/micro...f4157bfc4a9bba

Yosh
"Jeff" <je*******@mindspring.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I've got an application I'm converting from VB6 to C# 2005. I've
broken my problem down to this (Run on same machine seconds apart):

This works.

Dim dd As New DOMDocument
Dim pNodeList As IXMLDOMNodeList
Dim pNode As IXMLDOMNode

dd.async = False
dd.Load "http://rss.cnn.com/rss/cnn_topstories.rss"

Set pNodeList = dd.selectNodes("//item")
For Each pNode In pNodeList
Next pNode

This doesn't. I get a message that proxy authentication is required (I
didn't need it a second ago):

XmlDocument doc = new XmlDocument();
doc.Load(@"http://rss.cnn.com/rss/cnn_topstories.rss");
XmlNodeList rss = doc.SelectNodes("//item");
foreach (XmlNode r in rss)
{

}

What am I missing?

Thanks

Dec 21 '05 #2
See Ben Dewey's reply in the "Efficient way to firing event" topic. I think
he replied to the wrong post.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Subject: Re: Efficient way to firing event..... 12/21/2005 9:30 AM PST

By: Ben Dewey In: microsoft.public.dotnet.languages.csharp
In C# the \ char needs to be repleced with \\ meaning:

XmlNodeList rss = doc.SelectNodes("//item");

needs to be:
XmlNodeList rss = doc.SelectNodes("////item");
or
XmlNodeList rss = doc.SelectNodes(@"//item");

"Yosh" wrote:
I was trying to find an example for you and came across this article. I hope
this helps:

http://groups.google.com/group/micro...f4157bfc4a9bba

Yosh
"Jeff" <je*******@mindspring.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I've got an application I'm converting from VB6 to C# 2005. I've
broken my problem down to this (Run on same machine seconds apart):

This works.

Dim dd As New DOMDocument
Dim pNodeList As IXMLDOMNodeList
Dim pNode As IXMLDOMNode

dd.async = False
dd.Load "http://rss.cnn.com/rss/cnn_topstories.rss"

Set pNodeList = dd.selectNodes("//item")
For Each pNode In pNodeList
Next pNode

This doesn't. I get a message that proxy authentication is required (I
didn't need it a second ago):

XmlDocument doc = new XmlDocument();
doc.Load(@"http://rss.cnn.com/rss/cnn_topstories.rss");
XmlNodeList rss = doc.SelectNodes("//item");
foreach (XmlNode r in rss)
{

}

What am I missing?

Thanks


Dec 21 '05 #3
> See Ben Dewey's reply in the "Efficient way to firing event" topic. I think
he replied to the wrong post.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Subject: Re: Efficient way to firing event..... 12/21/2005 9:30 AM PST

By: Ben Dewey In: microsoft.public.dotnet.languages.csharp
In C# the \ char needs to be repleced with \\ meaning:

XmlNodeList rss = doc.SelectNodes("//item");

needs to be:
XmlNodeList rss = doc.SelectNodes("////item");
or
XmlNodeList rss = doc.SelectNodes(@"//item");


Correct, a backslash (\) needs to be "escaped", but this is NOT true
for a (forward) slash (/). So "doc.SelectNodes("//item");" is correct.

Hans Kesting
Dec 21 '05 #4
My fault that is correct. I get those confused sometimes.

Back to square 1...
Dec 21 '05 #5
Can you post the exact message you're getting?

Dec 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Jason Huang | last post: by
12 posts views Thread by Nathan Sokalski | last post: by
3 posts views Thread by Anoj Kumar | last post: by
49 posts views Thread by Zach | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.