473,609 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Read xml from a password protected site

Hi;

If I need to parse an xml file from a password protected site - like:
XmlReader xmlReader = XmlReader.Creat e("http://www.cia.gov/AgentList.xml",
readerSettings) ;

How do I pass in the username/password so it can get the url?

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

Jun 5 '06 #1
9 2634
Hi Dave,

This depends on what kind of authentication the server is requiring. Is it
using forms authentication or just basic ones?

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== ===========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =============== =============== =
=============== ===========

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jun 5 '06 #2
Hi;

It could be anything. We let users enter a url and then we go to pull the
xml from the url they gave us.

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

"Kevin Yu [MSFT]" wrote:
Hi Dave,

This depends on what kind of authentication the server is requiring. Is it
using forms authentication or just basic ones?

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== ===========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =============== =============== =
=============== ===========

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jun 5 '06 #3
David Thielen wrote:
Hi;

If I need to parse an xml file from a password protected site - like:
XmlReader xmlReader = XmlReader.Creat e("http://www.cia.gov/AgentList.xml",
readerSettings) ;

How do I pass in the username/password so it can get the url?


http://hhoover:cr********@www.cia.gov/AgentList.html

///Peter

Jun 5 '06 #4
Hi Dave,

In this case, you need to use XmlDocument class, to get the xml from that
URL. There is a property named XmlResolver, which you can specify an
XmlUrlResolver object. Then you can specify the Credentials for that
resolver. For more information, you can check the following link:

http://msdn2.microsoft.com/en-us/lib...lver.credentia
ls.aspx

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== ===========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =============== =============== =
=============== ===========

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jun 6 '06 #5
I think that's the one for the fbi, not the cia <g>.

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

"Peter Flynn" wrote:
David Thielen wrote:
Hi;

If I need to parse an xml file from a password protected site - like:
XmlReader xmlReader = XmlReader.Creat e("http://www.cia.gov/AgentList.xml",
readerSettings) ;

How do I pass in the username/password so it can get the url?


http://hhoover:cr********@www.cia.gov/AgentList.html

///Peter

Jun 6 '06 #6
that's it - thanks - dave

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

"Kevin Yu [MSFT]" wrote:
Hi Dave,

In this case, you need to use XmlDocument class, to get the xml from that
URL. There is a property named XmlResolver, which you can specify an
XmlUrlResolver object. Then you can specify the Credentials for that
resolver. For more information, you can check the following link:

http://msdn2.microsoft.com/en-us/lib...lver.credentia
ls.aspx

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== ===========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =============== =============== =
=============== ===========

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jun 6 '06 #7
You're welcome.

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== ===========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =============== =============== =
=============== ===========

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jun 7 '06 #8
Hi;

If I need to parse an xml file from a password protected site - like:
XmlReader xmlReader = XmlReader.Creat e("http://www.cia.gov/AgentList.xml",
readerSettings) ;

How do I pass in the username/password so it can get the url?

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com
HttpWebRequest myHttpWebReques t;
NetworkCredenti al netCred = new NetworkCredenti al("username", "password", "domainname ");
myHttpWebReques t = (HttpWebRequest )WebRequest.Cre ate(protectedWe bSiteURL);
myHttpWebReques t.Credentials = netCred;
HttpWebResponse myHttpWebRespon se = (HttpWebRespons e)myHttpWebRequ est.GetResponse ();
Stream data = myHttpWebRespon se.GetResponseS tream(); System.Text.Enc oding encode = System.Text.Enc oding.GetEncodi ng("utf-8");
StreamReader reader = new StreamReader(da ta, encode);
FileStream fs = File.Create(Ser ver.MapPath(fil eName));
StreamWriter sw = new StreamWriter(fs );
sw.Write(reader .ReadToEnd());
sw.Close();
fs.Close();

Posted from http://www.topxml.com/renntp using reNNTP: the website based NNTP reader.
Jul 21 '06 #9
thank you

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

"Natrajan" wrote:
>
Hi;

If I need to parse an xml file from a password protected site - like:
XmlReader xmlReader = XmlReader.Creat e("http://www.cia.gov/AgentList.xml",
readerSettings) ;

How do I pass in the username/password so it can get the url?

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

HttpWebRequest myHttpWebReques t;
NetworkCredenti al netCred = new NetworkCredenti al("username", "password", "domainname ");
myHttpWebReques t = (HttpWebRequest )WebRequest.Cre ate(protectedWe bSiteURL);
myHttpWebReques t.Credentials = netCred;
HttpWebResponse myHttpWebRespon se = (HttpWebRespons e)myHttpWebRequ est.GetResponse ();
Stream data = myHttpWebRespon se.GetResponseS tream(); System.Text.Enc oding encode = System.Text.Enc oding.GetEncodi ng("utf-8");
StreamReader reader = new StreamReader(da ta, encode);
FileStream fs = File.Create(Ser ver.MapPath(fil eName));
StreamWriter sw = new StreamWriter(fs );
sw.Write(reader .ReadToEnd());
sw.Close();
fs.Close();

Posted from http://www.topxml.com/renntp using reNNTP: the website based NNTP reader.
Jul 21 '06 #10

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

Similar topics

2
1765
by: Rickard | last post by:
OK. I have the need on a form submit to pass the data to anther system that require a login and password only I want to automate the process in an server side asp file and then process the response. I am having the form submit pass a users ss # and name to an asp file, I want that asp file to pass that info on to my "verifying" site along with the username and password for that "verification" site. Is there some way in asp to access a...
3
1593
by: netsurfer | last post by:
hi..I'm working on a project that requires files to be password protected on a UNIX based site. The people that own the web site want to be able to change the password every so often. Unfortunately, I have restricted access only to FTP so I really can't log in to any kind of Administrative Console or Admin Panel and see if there are folders that can be password protected and then have passwords changed on them. The people I'm contracted...
2
1553
by: RICHARD BROMBERG | last post by:
I am building a password protected ASP web site. (http://www.allscrewedup.org) When you go to this site there is a link in upper left corner (VIP) that takes you to a Logon Screen. The user must enter a user name and password to gain access to the secure pages which follow. This works fine and if the user can go back to the opening page by logging off (back to default link) .
5
7012
by: Gelios | last post by:
Hello All! I am going to crazy and feeling myself so stupid but I don't understand such behaviour. I have code: public int getNextAgentId() { Int32 agent_id = 0; IDataReader dr = dbap.DBDataReader("SELECT MAX(agent_id) FROM Agents"); if(dr.Read()) { agent_id = dr.GetInt32(0);
2
1951
by: Morten | last post by:
Hi! I'm wondering what it is that makes IE prompt users to save user name and password. I have a web site coded in C#/.Net and part of it is protected by means of a form. When I key in user name and password I'm not prompted to save this information. Lots of other web sites that I access give me this option. Can someone help me understand why I'm not asked by IE/Windows? Morten
5
2814
by: Darren | last post by:
Hello, we're fully paid up and signed up to a password protected site, so this isn't hacking. In this site we can download a price list in CSV format. What I'd like to do is have a PHP script log into the site and download the CSV file so we can then display it on our website. Is this posible?
4
2757
by: connoisseur.infotech | last post by:
hello we are developing one tool where we need to open and make password protected zip files. we found some solutions but they don't support password protected things. does any one knows about this or any aproach for this.
4
5127
by: apondu | last post by:
I'm trying to screen scrape a site that requires a password. I am using C#.Net, i am new to this and with the information available around on the internet i just put tht information into the code. But still i am not able to achieve what i want to. I have posted the code which i have written, along with the site and the userid ans password
1
1251
by: denniswong288 | last post by:
Hi, My website has PDF documents that's available for registered users to view online (through my site) only. Currently, I can't find any solutions to prevent users from downloading/"save-as" the PDF doc in their local drives, so I'm thinking of password-protecting these PDFs. This will ensure that they'd not be able to view the PDFs even though they download it and save-as local. However, how do I open these password-protected PDFs...
0
8571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6997
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5509
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4080
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2530
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1386
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.