|
Muammar© wrote: foreach (string f in arFiles) MessageBox.Show(arFiles[x]);
What the ...??
How about looking at the file names and not the first element of an array over and over again.
foreach (string f in arFiles)
Debug.WriteLine(f);
|
|
|
|
|
Yes, I guess we shouldn't code after midnight. Thanks Dave!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi,
The files are located in several subdirectories and something like this will find them for you.
private void FindFiles() {
String[] files = Directory.GetFiles(
System.Environment.GetFolderPath(
System.Environment.SpecialFolder.InternetCache),
"*.*",
SearchOption.AllDirectories);
foreach (String file in files) {
Console.WriteLine(file);
}
}
Alan.
|
|
|
|
|
Thanks Alan, that does it!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi,
The wsdl web service is behind proxy. I can access the wsdl with the iexplorer but I cannot access the web service with C# client which works fine when the client is on the same machine as the service or the service is not behind proxi. I tried using wsdl utility with /proxy but it generated the same stub as without this option.
What do I do?
Thanks.
|
|
|
|
|
Hi All,
I have worked on Windows Apps before and deployed them easily because there were no local DB, however this time I need to deploy a Winform [C#] application along with the SQL Server DB which contains several tables and stored procs.
The query is
1) How to deal all deployment issues using Setup project only?
Regards
Grk
|
|
|
|
|
i have a wireless router and i want to restart it from my app. 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
|
|
|
|
|
Hmm, the only thing that comes to my mind... You definitely have a web-interface on the router, with a restart button, you can try to see what's the request it sends (sniff?) and send it yourself, you will need to authorize first, of course
Regards,
Lev
|
|
|
|
|
Hmmm, you were faster, dang...
|
|
|
|
|
But you beat me.
Simon
|
|
|
|
|
i had another idea by using these Functions
[DllImport("user32.dll")]
public static extern bool SetCursorPos(int X, int Y);
[DllImport("user32.dll")]
public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);
[DllImport("user32.dll")]
public static extern IntPtr keybd_event(int key, int dummy, int flags, IntPtr info);
hope you got me, but i dont like that way
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
|
|
|
|
|
That seems to complicated. You should give the idea with the web interface a try.
|
|
|
|
|
im not too good in that web thing...this is complicated than that
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
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|