|
Thank you very much, that will help me a lot!
The windows does still appear!
And how to get that stream?
this doesn't work:
System.Diagnostics.ProcessStartInfo info = new ProcessStartInfo("CMD.exe", "/C net stop messenger");
info.CreateNoWindow = true;
Process process = new Process();
process.StartInfo = info;
process.Start();
StreamReader s = process.StandardOutput;
MessageBox.Show(s.ReadToEnd());
|
|
|
|
|
System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo("cmd.exe", @"/c dir D:\");
info.UseShellExecute = false;
info.CreateNoWindow = true;
info.RedirectStandardOutput = true;
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = info;
proc.Start();
StreamReader reader = proc.StandardOutput;
proc.WaitForExit();
Console.WriteLine(reader.ReadToEnd());
This works fine for me
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I know this sounds like very simple but ... I am new to .net adn i don't know how to do that.
I have a solution which includes 4 projects which was shared by other solutions (projects) too ... now I want to checkout thoes project rename i mean change namespace as current souutionname.projectname ...
any idea how do i do that .. should i just chekout .. rename as the namespace i want and then inculding in the current solution ..??
Any advice ..please
Thanks,
Ambar
|
|
|
|
|
If you want to change it only for the current sol. ,so copy these projects to another directory that is not shared by others and rename it throught this directory.
|
|
|
|
|
I know this sounds like very simple but ... I am new to .net adn i don't know how to do that.
I have a solution which includes 4 projects which was shared by other solutions (projects) too ... now I want to checkout thoes project rename i mean change namespace as current souutionname.projectname ...
any idea how do i do that .. should i just chekout .. rename as the namespace i want and then inculding in the current solution ..??
Any advice ..please
Thanks,
Ambar
|
|
|
|
|
To get to objects in other namespaces, make sure those objects/classes are in the same project as the one you're building, or if they're in a different project, add a reference to the project you want to access. Then it's just a matter of MyNamespace.SomeObject
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
how can I assign the enter key on the keyboard to activate a dialog box message.Would it be assign in a resource file or???
After all, Today is the Tomorrow you worried about Yesterday
|
|
|
|
|
For a Windows Forms app, in your form class, override ProcessCmdKey and watch for a key press. When pressed, create a new Form and call ShowDialog() on it.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
It is not a windows form app
I have this app (Game) I want to be able to design a caht dialog box that act as a CHAT during the game betwwen two PCs. I want it to be invoked by pressing ENTER on the keyboar the I write some chat stuff the I press ENTER agin to send the message to other PC
Ps. Your site is an intersting one
Good luck
After all, Today is the Tomorrow you worried about Yesterday
|
|
|
|
|
Try a keyboar hooker, as I remeber in CP you can find minimum 2 in C# .
|
|
|
|
|
As the other poster said, look into Windows hooks, there's an article here[^] with an example. Using hooks, you can listen for all keyboard activity on the system.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
how can i remove flicker from my program .. i am trying to make a simple game of tettris (don't know how to spell it correctly). i have to move a shape from top to bottom so my control is doing this for me .. logic i m using is simple ( i think it is) i m using paint function of my control just to fill a perticular block whose value is 1 and and empty whose value is 0 so i need to call paint function after every some time. but Invalidate function is creating flicker. is there any other way i can use or i i can paint some shapes constantly without using paint function ?? i have tried to use some other my own written function but they are not working until i call 'em from paint function of my control what should i do..
|
|
|
|
|
|
Search Codeproject or the web for System.Windows.Forms.ControlStyles.DoubleBuffer, it will get rid of the 'flashing'/flicker when you draw to a windows form.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
Add these 3 lines to your form constructor
// Enable Double Buffering to remove flicker
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
Hope this helps
Publicjoe
C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html
C# Ebook at http://www.publicjoe.f9.co.uk/csharp/samples/ebook.html
VB Tutorial at http://www.publicjoe.f9.co.uk/vbnet/vbnet.html
VB Ebook at http://www.publicjoe.f9.co.uk/vbnet/samples/ebook.html
Mirrors at http://dowhileloop.com/publicjoe/ and http://publicjoe.dowhileloop.com
|
|
|
|
|
Or better yet, a single line, with the flags OR'd together:
this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
Just imagine I want to create an Order ID. How can I create a unique Order ID that may look something like P123J2K or atleast like 938470 ??
The only way I know is: to start the Identity of the Order table at e.g. 10000; OR to use Guid. But Guid creates a 30+ character ID, which is too long for an Order.
So is there any better way to create Order IDs, specially without connecting to DB.
|
|
|
|
|
well Hasan
as far the auto creation is concerned as you said you have identity or unique GUID. in other case you need to do some custom logic to build the orderID. like use triggers in SQL and customize the number according to your need. or if you need some thing unique without connecting to database the do this
for e.g Use Machine name as a key to make it different from other computers. then date and time to make the orderID like this
variableName = datetime.now + System.Environment.MachineName
if customer is registered then you can also use customerID to make it more convinient
over to you....
|
|
|
|
|
Rizwan sahib, thanks for different ideas.
|
|
|
|
|
hi all,
This is simple question..But I don't know..
I want to hide the C# Application when openning it.
I applied in main Windows Form like this:
private void Form1_Load(object sender, System.EventArgs e)
{
this.Hide();
}
But Window is not HIDE..
can any body help?
thanks in advance..
|
|
|
|
|
I've had that problem before also...
/\ |_ E X E GG
|
|
|
|
|
Try to set the Visible property to false in the constructor of the form and see if that helps.
|
|
|
|
|
two ways
1. create one public procedure with any name say "LoadForm()" in that form and put all the code from load event to this procedure
and instead of calling
frm.show call frm.loadForm()
2. try this in activate event of the form write
this.Hide();
|
|
|
|
|
Instead of putting this code in the Form.Load event, override the OnLoad method of your form and put it in there. You have much greater control over the form visibility that way.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Probably the cleanest hack: Set the application to start minimized. Also specify that your application doesn't show in the taskbar.
Alex Korchemniy
|
|
|
|