|
how about adding username and password as command arguments
eg.
cmd.exe "username" "password"
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)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Thanks Dear,
But no, can't add like that. Can either pass a txt file or input on screen. As I don't want to have txt file with readable username & password, so thought of this option.
Thanks & Regards,
|
|
|
|
|
Perhaps you're looking for this[^]?
|
|
|
|
|
Thanks, but I don't want such huge code for a small task.
I believe such a thing can be done with no big pain. Couple of days ago I had seen a codeo nsome site that showed stdin & stdout using Process and cmd. I searched a lot but couldn't find that site back.
On my start of process, immediately after 1 line, cmd needs to input username. The code I have written doesn't let the user write anything and just goes away. When and how can the app know that it needs to write/input something. If its the 1st time then its username, if 2nd time then password. That's it. Then no input only get the output.
But am not able to know when and how to know. Just saw WaitForInputIdle(). Might be that can help me. Will try with that.
Thanks & Regards,
|
|
|
|
|
I think you don't need anything going asynchronous here. Remove the OutputDataReceived event handler and the invoke to BeginOutputReadLine, so you can do it synchronously. For example:
I've not tested the code, but I guess it should work. The OutputDataReceived is only fired when a line is written on the output stream, so if there is not an end of line when it is asking for a username, you will not receive the event.
|
|
|
|
|
Why stack trace is not preserved in that code?
static void Function()
{
try
{
int[] data = new int[10];
data[100] = 1;
}
catch (Exception e)
{
throw;
}
}
static void Main(string[] args)
{
try
{
Function();
}
catch (Exception e)
{
Console.WriteLine(e.StackTrace);
}
}
The results are the same for throw or throw ex .
at ExTest.Program.Function() in ... ExTest\Program.cs:line 21
at ExTest.Program.Main(String[] args) in ... ExTest\Program.cs:line 29
Чесноков
|
|
|
|
|
You need to throw a new exception to preserve Inner Exceptions:
Try This:
try
{
Function();
}
catch(Exception ex)
{
throw new Exception("Your new error message", ex);
}
Hope this helps.
|
|
|
|
|
Documentation states that throw preserves stack trace and throw e does not.
You approach incurs handling of the inner exceptions.
Чесноков
|
|
|
|
|
Chesnokov Yuriy wrote: throw e does not
incorrect.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Dear All,
I have a query in teechart.
I have created a horizontal bar chart in C# using tee chart. Now i want to change the color of the bar depending on its value(e.g. green color for positive value & red for negative).
any settings in the property?
can anyone give solution on this?
thnx
|
|
|
|
|
Hello all,
Many times during working on web projects I come across handling the customized search page for comodity. Many times it contains 10 to 20 fields which is quite a good number to pass another page and to code.
I want to know if there is any efficient way to handle such situations.
Thanks
|
|
|
|
|
Hi!!
I dint know where to post it...
But i want to know which Application of Windows responds to Win +D (used to view Desktop) and other such combinations??
Ayan
|
|
|
|
|
Windows Explorer I'd say. How is this a C# question?
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
tell me where shud i post this question...
One more thing...
Windows Explorer(explorer.exe) can read all the keystrokes??
How is this whole process is working???
Can u plz explain...
I'm just curious...
|
|
|
|
|
Windows can react to specific key combinations, known as hotkeys or hooks. Google these terms. And have a look at functions such as RegisterHotKey and http://support.microsoft.com/kb/318804[^]. Explorer must be using one of those.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Thanks...
But i dint get anywhere...
Thanks anyway...
|
|
|
|
|
Hi!!
I wanna code a method that can restart the application without any user involvment..
I mean when an error is encountered, the method can be used to restart the application..
Plz help me out...
|
|
|
|
|
You can use following code to do so
Application.Exit();
Process.Start(Application.ExecutablePath, "/restart" + Process.GetCurrentProcess().Id);
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
How will it work can u plz explain..
i mean after this Application.Exit(); how will Process.Start(...); will be executed???
|
|
|
|
|
Ok its working....
Thanks for this...
But will it work on a Console Application too...
I cudnt find this Application...
How shud i integrate it in my code??
Its not exiting but ya its opening another instance...
How shud i get it working...
|
|
|
|
|
Try following code
Close();
System.Diagnostics.Process.Start(Application.ExecutablePath);
or you can also do following
Add using System.Windows.Forms; to the top and call
Application.Restart();
You may need to add the reference: "System.Windows.Forms.dll" to your project.
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Close() cant be used... m using Visual Studio 2010 n its not allowing... I mean its giving error...
And Application.Restart() is working fine but it aint closing the previous instance...
How shud i close the console window forcibly.. Should i use Process.Kill()??
|
|
|
|
|
Ya you can also go for kill method to kill your process...
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
To kill the application i've used
Process.GetCurrentProcess().Kill();
To restart
{
Process.Start(Application.ExecutablePath, "/restart" + Process.GetCurrentProcess().Id);
Process.GetCurrentProcess().Kill();
}
Thanks for the help...
If u can find anyother more appropriate way plz let me know...
Ayan
|
|
|
|
|
Application.Restart();
stops the current process and starts a new identical one.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|