|
Don't like that idea either, this is very error prone
Regards,
Lev
|
|
|
|
|
Hi,
I guess your router has a web frontend to manage. There will be a site/button to reset the router. Maybe you could send a HTTP request to the router, simulating that a user pushes the button.
Regards
Sebastian
|
|
|
|
|
Ask the router manufacture if they expose functionality via an API.
Or
Most routers have a browser based interface. Look in the interface for a reset button. Look at the HTML source for the page, and see if you can figure out what happens when the button is pressed. Is it some JavaScript, or something. It should be possible to send the required http messages to simulate a press of this button.
Simon
|
|
|
|
|
no, manuf. wont. Well, i have already tried to check the source but there wasnt anything useful...
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Use a http debugger liker fiddler[^] to track the http requests that get sent when you hit the reset button. You should be able to duplicate these from your program.
Simon
|
|
|
|
|
nope, its just send same link as when i hover mouse over the restart button. I kept get this message
Fiddler has detected a protocol violation in session #XX.<br />
<br />
Protocol violation. No Connection-Close, no Content-Length. No way to tell if the response is complete.<br />
XX keeps change
Transport
-Location: http:
Entity
-Content-Length: 0
Misc.
-Server: RomPager/4.07 UPnP/1.0
above is Header info
info
POST http:
302 Found to http:
edited :
wow, i dragged that request to request builder and executed but it didnt work. Then when i loggin in router and send again it worked, Router restarted. Now can you please explain what to do next, i mean how to use that request thing and the main thing "How to log in router" ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
modified on Tuesday, December 16, 2008 9:39 AM
|
|
|
|
|
Restarting the router from the GUI will probably just issue a HTML POST request to the webserver on the router - you can take a look at the HTML source of the web interface where this is done.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
no man, HTML POST worked after all...I'm glad its working...Yuppy
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Well now you have the full details of the request that can be used to restart the router. Like Greeeg said, it's probably just some form of HTML post message. Take a look at the message and look at the details.
The log-in is probably some form of https authentication. Again, if you look at the requests with fiddler you should be able to work it out. (If it is https, don't forget all the data is encrypted, so it will just look like random strings).
You can use WebRequest.Create() and the HttpWebRequest[^] class to create and send your requests to the routers 'web server'. Then populate the request object with any required details that you have discovered by logging the real request with fiddler.
Simon
|
|
|
|
|
dude, didnt read your post...but i get it worked. Thank you so much for all your help and all others those at least tried. Special thanks for Fiddler like thing(you got 5 from me)
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
![Go to Parent](https://www.codeproject.com/App_Themes/CodeProject/Img/arrow-up24.png) a hell thing happening...the code works only when Fiddler is running. If i close the Fiddler then i get "Unable to Connect remote server" exception
here is code :
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://192.168.1.15/Forms/tools_system_1");
request.Method = "POST";
request.ProtocolVersion = HttpVersion.Version10;
request.Credentials = new NetworkCredential("admin", password);
request.UserAgent = "Opera/9.62 (Windows NT 6.0; U; en) Presto/2.1.1";
request.Accept = "text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1";
request.Headers["Accept-Language"] = "en-IN,en;q=0.9";
request.Headers["Accept-Charset"] = "iso-8859-1, utf-8, utf-16, *;q=0.1";
request.Headers["Accept-Encoding"] = "deflate, gzip, x-gzip, identity, *;q=0";
byte[] authBytes = Encoding.UTF8.GetBytes(("admin:" + password).ToCharArray());
request.Headers["Authorization"] = "Basic " + Convert.ToBase64String(authBytes);
request.Referer = "http://192.168.1.15/maintenance/tools_system.htm";
request.KeepAlive = true;
request.ContentLength = 32;
request.ContentType = "application/x-www-form-urlencoded";
byte[] postBytes = Encoding.ASCII.GetBytes("restoreFlag=0&RestartBtn=RESTART");
Stream requestStream = request.GetRequestStream();
requestStream.Write(postBytes, 0, 32);
requestStream.Close();
any idea ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi all,
I have an application that attemps to connect to a database.
I have one machine running XP that connects to a server machine with SQL server 2005 installed.
In this instance i can connect every time, any time with no issues.
My second machine is running Vista Business SP1, and connects to a server with SQL Server 2008 installed.
I had spent alot of time trying to get the application to connect to the database as I initially had an 'error: 26 - Error Locating Server/Instance Specified' message. so i did the research on that and all suggestions seemed to already be applied in my case. Anyway after a number of hours after server restart it works.
The next day, application failed again. I did a server restart and did not work for while, but then it started to connect again, then stopped again. Basically with no change to the application its working sometimes but not others.
If i use command prompt and 'osql' commands i am always able to detect the server\instance i want, and i can also retrieve data from it. so i cant see how it is a server setup issue. but if it is a programming issues why would it work sometimes and not others.
Does anyone know of any extra coding required when working the SQL server 2008, over 2005
my relevant code is as simple as follows.
connection string is:
Server=<server>\<instance>;Database=<database>;User Id=<username>;Password=<password>;
using System.Data.SqlClient;
SqlConnection connection = new SqlConnection(@connectionString);
connection.Open();
Any help or suggestion will be great
Thanks
|
|
|
|
|
Hi,
your connection string looks kind of strange to me. Are you sure that this is correct. I'm missing the servername\instancename...
Regards
Sebastian
|
|
|
|
|
Sorry, it didnt display how i typed it.
the blank values do have data in:
Server=server\instance;Database=database;User Id=username;Password=password;
the Bold values are masked
as i have said i did manage to connect a couple of times, with the same connection string, so i cant see that being an issue
thanks
|
|
|
|
|
Hi,
try this ..
connectionString="Data Source=<database server="" ip="">;Initial Catalog=<databasename>;Persist Security Info=True;User ID=<user id="">;Pwd=password"
Charith Jayasundara
|
|
|
|
|
Hi Charith,
Thanks for your input.
As I said in my post. My application connects sometimes and not others. At the minute it is working, so I can verify that your connection string suggestion is valid. but so is the connection string I was originally using so I can not say that my solution is solved.
|
|
|
|
|
This could be a connection pool issue. Have you tried disabling connection pool; Specify Pooling=false to your connection string and test if it has any effect.
Also is the message 'error: 26 - Error Locating Server/Instance Specified' still the one you receive or are you getting any other messages.
|
|
|
|
|
Thanks for your reply Mika,
Curently my application is connecting and setting the Pooling=False has no noticable affect. From what I just read about Pooling thou, it seems best to leave this at the default 'True' value as it can improve performance with database applications the use the same connection strings over and over again.
(http://msdn.microsoft.com/en-us/library/8xx3tyca.aspx[^])
Whenever I cannot connect the 'error: 26' message is the only one I have ever recieved in regards to this issue.
At the moment the application has been able to connect with no errors since last night, so fingers crossed that it stays that way :P
If the problem has been solved in my case then I can only conclude that there was an issue with some server setting. If I manage to find a definative answer to my problem I will post my findings here.
|
|
|
|
|
musefan wrote: Curently my application is connecting and setting the Pooling=False has no noticable affect
Ok, so it seems that the pooling isn't affecting
musefan wrote: what I just read about Pooling thou, it seems best to leave this at the default 'True'
Absolutely. The idea was just that you should test if the pool acts correctly. In some situations you can end up with connections in the pool but they won't work thus leading to an error.
musefan wrote: At the moment the application has been able to connect with no errors since last night, so fingers crossed that it stays that way
Let's hope so.
|
|
|
|
|
Nope it gave in eventually.
Now I am using the server IP address and instance name and worked as soon as I changed it. If this lasts then there must be some issue with resolving the DSN at some times and not other.
Any ideas on this?
|
|
|
|
|
Hi all,
I have a problem. I'm using VS2005 and I'm writing a web service. It's been working fine so far. Now, when I try to debug the code whenever I step over/in a line of code it goes to some random line elsewhere in the code.
Sometimes, when I stop the program and then run again it automatically stop on a breakpoint without even Invoking the web service!!
I tried Cleaning the solution, removed all .pdb files but nothing helped. Does anybody have a solution for this because it's driving me crazy!
In life truth does not matter. What really matters is what others believe to be the truth. (The Up and Comer - Book)
|
|
|
|
|
Is it multi-threaded application?
Charith Jayasundara
|
|
|
|
|
no ... it's just a webservice.
In life truth does not matter. What really matters is what others believe to be the truth. (The Up and Comer - Book)
|
|
|
|
|
There's no chance that there are multiple calls occurring to the webservice during your debugging?
|
|
|
|
|
This usually happens when the source file and the pdb files are out of sync. This means the compiled version does not correspond to the current version of the source files.
Erase all binaries, unGAC if necessary.
|
|
|
|