|
Wow thanks!
This is great, but is there anyway to use
ConsoleKeyInfo
.key
ConsoleKey
etc instead?
Thanks in advance ^0^
|
|
|
|
|
Nevermind I figured it out on my own, all I had to do was change/add these two lines.
^O^. Thanks!
ConsoleKeyInfo keyInput = new ConsoleKeyInfo();
while (Console.ReadKey().Key != ConsoleKey.Escape) ;
|
|
|
|
|
Ran into a slight problem.
This performs actions within the while without stopping to check for the key but how do you add additional keys?
So the loop goes constantly checking for an escape key press, and if it happens it breaks the loop.
but what if I want it to perform actions based on other keys while its looping?
If you got any info that would be great. =O)
-- modified at 16:12 Monday 18th June, 2007
Don't worry again I think I cracked it.
|
|
|
|
|
If anyone is interested in how this is done. I basically modified it so that it reads the key in the thread inside the loop over and over, and it does things according to whatever the key is. This is just an example.
static void Main(string[] args)
{
object key = new object();
bool stopLoop = false;
ConsoleKeyInfo keyInput = new ConsoleKeyInfo();
Thread t1 = new Thread(delegate()
{
while (keyInput.Key != ConsoleKey.Escape) // repeats the below code until...
{
keyInput = Console.ReadKey(); // Constantly checks for pressed key
if (keyInput.Key == ConsoleKey.UpArrow) // does things depending on key
{
Console.WriteLine("Up Arrow");
}
if (keyInput.Key == ConsoleKey.Escape) // the loop break
{
lock (key)
{
stopLoop = true;
}
}
}
});
t1.Start();
while (true)
{
Thread.Sleep(200); // Putting a delay in so it doesnt run at a billion mph
Console.Write("01"); // Writing numbers just to visually check the speed
lock (key) // This stops the loop if Escape is pressed as defined above.
{
if (stopLoop == true)
break;
}
}
}
}
}
|
|
|
|
|
Hello everybody!
My team and I is facing a big problem write now, and after two days of searching and testing we didn't succeed!
We have to close a Database File (SQLite) on our local machine, which was opend from our process.
This is kind of a workaround, because the Database crashes thanks to a bug in SQLite, and after that the file is locked!
What we found out is that it would be much more simple, if we wanted to close a locked file from across network shared computer.
Like this[^] very nice post, from Heath Steward shows.
In this case we could use netapi32.dll methods.
Maybe someone can point us the write direction.
-- modified at 6:44 Monday 18th June, 2007
As a workaround we now start a freeware program "unlocker" which works.
But this is the soulution we do not prefere (Which is all said by "workaround")!
Thanks for your time!
All the best,
Martin
-- modified at 6:48 Monday 18th June, 2007
|
|
|
|
|
hi gurus,
I have C# application with ms-access back-end, this application is running on remote side. means already deployed, now i have to make some changes in tables which i had already made through alter table in oledbcommand object, but when turn comes to make changes in query object i got stucked. does any body have any idea how can i alter query object of access at run time through c#.
|
|
|
|
|
Try this.
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
When i run may application,
My applicaton should find the password field in the internet explorer and edit that control using user32.dll.
for example, in yahoo login page when i press the hot key then i want to find the username and password field and edit it using user32.dll.
kathir
-- modified at 11:15 Tuesday 19th June, 2007
|
|
|
|
|
What?
Regards,
Satips.
|
|
|
|
|
He said: "When i run may application,
My applicaton should find the password field in the internet explorer and edit that control."
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
Hiys application should rock then!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
this.FindControl("controlName");
is this ok
|
|
|
|
|
Hi,
I have created a sample Windows Service, in which I want to provide a notify icon on the system tray.
I have placed a notify icon and a contextmenustrip on the Service's Designer form, and on the OnStart() method of the Service I have assigned a value to the contextmenustrip property of the notifyicon. The following code snippet is written on the OnStart() event of the service,
contextMenuStrip1.Items.Add("Login");
contextMenuStrip1.Items.Add("ViewRecentDocuments");
notifyIcon1.ContextMenuStrip = contextMenuStrip1;
notifyIcon1.Text = "Notifier";
notifyIcon1.Visible = true;
After that I have installed the Service in the system, and started the service. The notifyicon get displayed, but while right-clicking on it, contextmenu didnt displayed.
Is my code is correct one, if not what change should I do, to make the contextmenu to be displayed on notifyicon's right-click event..
Anyone knows the solution, please reply me.
Thankfully,
jm
|
|
|
|
|
Hello,
i use iTextSharp to sign my PDF documents. I use .p12 / .pfx certificates. It works well, but i have a problem with the culture info i think. The problem ist that i have a certificate with an owner including 'ä' as letter. but when signing the document, the 'ä' is transformed into a 'd'. Does anybody know how to fix this problem?
Thx,
|
|
|
|
|
Hi all,
I have a service application and a windows application to manage that Service application. Now i can stop, run and pause.. my service application from my windows app. But i cant run a method from Service application or any similar things. I want to get some values from Service app. but i don't know the best way to commonicate witn an service app. Please help me about this issue.
Thans for your interesting.
Murad from Istanbul
|
|
|
|
|
You can make a server application within the service...use dotnet remoting
Best regards
Hansjörg
|
|
|
|
|
If the windows application is on the same PC as the service best is to use .NET Remoting with IPC protocol. Registering a IPC port will not make the firewall jump and you can use binary serialization.
http://stefanprodan.wordpress.com
|
|
|
|
|
Thank you very much. This is enough for me.
Bye for now
Murad from Istanbul
|
|
|
|
|
I am just wondering why you need to take a long route..If the need is to run sone function and get a value back why dont you define OnCustomCommand and pass a value.You have the room to pass between 128 - 256 this you can execute up to 128 custom functions in side the service.
|
|
|
|
|
Because i can't find a any way to get back any values from service application. OnCustomCommand is void and i can't use 'return obj' in OnCustomCommand method. If you know a good way for it, please write it to me.
Thanks.
Murad from Istanbul
|
|
|
|
|
|
First step - buy a book like Inside C# and work through it. This will teach you C#
Second step - buy a book on windows forms and work through it. This will teach you forms programming in C#
Third step - try google when you're stuck.
The WindowState property is how you maximise a window.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
this.WindowState = FormWindowState.Maximized;
|
|
|
|
|
how can i make a text-2-speech software for my own language pashto(eastern language written from Right to left).please any body help me.Its my prroject.or tell me the basic steps to make it.
ThanX
|
|
|
|
|
Please don't spam the entire site. To do this is not trivial, you need to either record all the words you want to say ( brute force ), or you need to record all the different sounds in your language and write a parser to work out the sounds from the words.
I don't see how you expect more than this, although this is pretty obvious, when you're asking such a top level question in an online forum.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|