views:

24

answers:

1

Basically, i want to change settings in a routers settings page as found in common soho routers and i am unable to even get past the first step! that is, going to the page without prompting the user for their username and password (this is a must), you can assume i have the user/pass details.

so i tried to access this page for instance...

http://username:[email protected]/ [where username and password are variable]

And i get a message from internet explorer 8 saying "windows cannot find 'http://username:[email protected]/' please check the spelling and try again"!

i was hoping to access this using the webbrowser control so i can make changes, but if i cant even enter i have no hope. doing this in opera however, worked. however, opera is irrelevant as it must be accessable programmatically somehow, and if i go webbrowser route, it must work in ie8, unless i go through webrequest class, which would be a parsing nightmare.

any thoughts on my first hurdle? (entering) and perhaps, my additional hurdles? (accessing config settings/ rebooting router / basic functions etc).

btw, i heard about snmp and understand that its rarely available in SOHO routers so this is out of the question, thanks.

UPDATE: Just did some testing, and running the above URL syntax through the webbrowser control poses no problems, in other words, it works. running it manually in ie8 doesn't work though, same error message. weird, but i have solved my first hurdle... now to my second... how to make this work on at least 90-95% of users? awch (gulp) how many browsers would i need to code the reboot/recycle router command for do you guys think?

A: 

You could try using watin test recorder: http://watintestrecord.sourceforge.net/

It is originally used to record test suites for automated testing of web sites that watin can run by remote-controlling a web browser (IE or Firefox).

You could record a test case that set properties the way you want and then generate e.g. C# code for this. You can then create a C# application that run this code.

Andreas Paulsson
I think it is perhs much easier to use the webbrowser control as this seems very hacky, but my main problem in logging in without user being prompted so I can do some HTML parsing and command sending thereafter. However I appreciate your input, any other ideas?
Erx_VB.NExT.Coder
I see your point in using the WebBrowser control since you do not need to depend on another tool, but my main point was to get it to easily generate a script that can be played. You could also use Firebug or Fiddler to look at the actual HTTP traffic to find out the login is performed. It is probably a HTTP post with username and password parameters that set a cookie in the response. You can use WebBrowser.Navigate2 to perform a POST.
Andreas Paulsson
Andreas, yes you are right, i will do the commanding either using webbrowser control or the other method you mentioned, but right now i can't even login using the URL syntax i posted above, could you try the same to login to your router to see if it works or if IE gives you the same error?
Erx_VB.NExT.Coder
i updated the main question with testing updates.
Erx_VB.NExT.Coder
According to http://support.microsoft.com/kb/834489 , this address syntax does not work with IE7 and up. WebBrowser control is according to MSDN (http://msdn.microsoft.com/en-us/library/w290k23d(v=VS.85).aspx) a managed wrapper for the WebBrowser ActiveX control which is according to http://msdn.microsoft.com/en-us/library/aa752041(v=VS.85).aspx a wrapper to IE 4.0, which is why it works in the WebBrowser control.
Andreas Paulsson