Forum Moderators: open

Message Too Old, No Replies

logging into website programmatically

         

t020673

6:04 pm on Sep 28, 2005 (gmt 0)



I'm building a VB.Net program that interfaces with a number of printers in my organization. These printers can be access by typing in their IP address into a browser. My program specifically needs to connect to each printer and set the internal time. Most of the printers are not password protected so I can use the "GET" method to acquire the html code from the printer, and the "POST" method to send data back to the printer. My dilemma involves posting data back to printers that required a username and password. How do I programmatically send the username and password so I can access "GET" the html I need and then "POST" the new time back to each printer.

Thanks.

mrMister

12:10 pm on Sep 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmasterworld.

Which authentication method does the printer use?

t020673

1:55 pm on Sep 29, 2005 (gmt 0)



Basic Authorization.

mrMister

5:04 pm on Sep 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're using .Net, I assume you're using the HttpWebRequest object, in which case, you need to add the following line of code after you create an instance of the HttpWebRequest object...

YourWebRequest.Credentials = new NetworkCredential("username","password")

(change YourWebRequest to whatever you've named your HttpWebRequest instance)

t020673

10:28 pm on Sep 29, 2005 (gmt 0)



Your assumption was correct, and your solution worked. Thank you...