TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jcwright77
NA
3
0
Accessing secure http
Jun 16 2004 11:39 AM
Here is the scenario. I have an http site that pops up a request for a username and password before you can enter any part of it. The reason for gaining access is so that I can read an XML file (achieved w/out user/pass) and download a file (achieved w/out user/pass). Both of these are on seperate places on the http site. The question is, how can I make my C# program automatically enter the username and password (silently) so that I can then do my business? Username and password is provided in the code. Here is what I am working with: public static void Connect() { string url = ConfigurationSettings.AppSettings[@"mainSite"]; string username = ConfigurationSettings.AppSettings["username"]; string password = ConfigurationSettings.AppSettings["password"]; HttpWebRequest request =(HttpWebRequest)HttpWebRequest.Create(url); request.Method = "POST"; using (StreamWriter sw = new StreamWriter((request.GetRequestStream())); sw.Write("Username="+username+"&Password="+password); HttpWebResponse response = (HttpWebResponse) request.GetResponse(); } It fails on the getrequest stream, but I am unsure about what to write to the stream.
Reply
Answers (
0
)
Pass datarow to remoting.
printing multipage tiff images - web application