|
Seraphin wrote: Try to open 2 or more SharpDevelop Instances and you'll see that you only get one of them.
Nope I get all processes running as listed in the TaskManager
Seraphin wrote: First get the ThreadID with the Win32 API and then get the ProcessByID, this works.
Seems a long way around.
Try putting the following code:
using System;
using System.Diagnostics;
class ListProcesses
{
static void Main(string[] args)
{
foreach (Process proc in Process.GetProcesses())
{
Console.WriteLine(proc.ProcessName);
}
Console.Write("Press ENTER to continue...");
Console.ReadLine();
}
} Into a text file, name it something (like listprocesses.cs) then run csc listprocesses.cs to compile it and then run listprocesses.exe .
I just had a thought, are you running in a doman because maybe there's some security restriction in place which stops programs accessing other programs. Just a possibility?
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
hi
how to insert exe file into another exe file (or bind to exe file) and extract they when user click on my exe file ??
codeproject is best ..
thanks..
bye ..
|
|
|
|
|
One method would be to compress the application to reduce it's size (if that's a problem) and then encode the resulting compressed executable in a resource file as a Base64 string. To extract it reverse the process.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
I have a trailing CR or LF in my texbox2.text output from the following.
Any ideas on how I can remove that? (Also any regex help is appreciated.. It is a mystery to me)
p.Start();
sw = p.StandardInput;
sr = p.StandardOutput;
err = p.StandardError;
sw.AutoFlush = true;
sw.WriteLine("nbtstat -A " +textBox1.Text);
sw.Close();
Regex macaddy = new Regex("=(?<MAC>.+)");
string fred;
fred = sr.ReadToEnd();
Match m = macaddy.Match(fred);
if (m.Success)
{
textBox2.Text = (m.Groups["MAC"].Value);
}
else
{
textBox2.Text = ("No Mac Found");
}
|
|
|
|
|
kago512 wrote: Any ideas on how I can remove that?
How about:
textbox2.Text = textbox2.Text.Substring(0, textbox2.Text.Length - 1);
Since CR LF is (on Windows) the same as \n . If you're using WriteLine then you only need to remove the last character since, basically, .NET takes care of whether you're using \r\n or \n .
Regarding Regular Expressions can you provide some more help as to what your problem is.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
|
I Need To Run Program (EXE) and Display in my Form (project)
have a nice day!!!
|
|
|
|
|
([A-F0-9]{2}-){5}[A-F0-9]{2}
This Regex should work, at least it does for me.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Good day everyone,
I need to design and implement a Class Library project for the Heap data structure.
Is there anyone know where I can have a reference or a sample project?
If you're interested in, pls help.
Thanks so much.
eric
|
|
|
|
|
Wikipedia
K&R
Depending on what you want to accomplish and what operations are required it could be quite easy but then again quite hard, as with all projects.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Hi.
How can I close right click on flash files, In code or in fla file itself ?
I have used flash player component.
Best wishes
|
|
|
|
|
How about asking an appropriate forum such as the Web Development. It's the more appropriate one and people there are more likely to have an idea on a solution.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Hi
I need an example that read XML file and insert the data into
database (SQL SERVER )
thanks
eyalso
|
|
|
|
|
Hi, Could someone give me some information on Adding items from a listView to an arraylist. i've done alot of searching and i haven't been able to find anything.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Is this what you're looking for?
ArrayList myArrayList = new ArrayList();
for (int nItem=0; (nItem < myListView.Items.Count); nItem++)
myArrayList.Add (myListView.Items[nItem]);
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I believe so sir! thank you very much
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Hey guys,
im trying to implement a specific Panel-Control, to which one can only
add RadioButtons (or any other Control that is wanted).
Because im working on a kind of designer its very important that it would be possible
to add every other kind of control but only RadioButtons shall be accepted and thus be really added.
I tried to understand how all the panel-calls work and ended up in trying to change the OnControlAdded-method:
protected override void OnControlAdded(ControlEventArgs e)
{
if(e.Control is RadioButton)
{
base.OnControlAdded (e);
}
else
{
try
{
base.OnControlAdded(new ControlEventArgs(e.Control));
base.Controls.Remove(e.Control);
}
catch(Exception ex)
{}
}
}
The problem is, that it works quite good (even though it sucks, that the control is first added and then removed...) but I get an error after the method is left.
It seems that another method, which is not visible to me, tries to access the removed Control and thus trows an error (System.ArgumentException: ControlCollection.GetChildIndex(Control child..)).
I tried working out which method this could be but ended nowhere.
It would be nice if you could give me a small hint and some help
Any help is appreciated,
Matthias Rost
|
|
|
|
|
Does the stack trace reveal the source of the exception?
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Well, I hope that helps:
Piped error: System.ArgumentException: 'child' is no subisdiary Control of this superior Element.
at System.Windows.Forms.ControlCollection.GetChildIndex(Control child, Boolean throwException)
at System.Windows.Forms.ControlCollection.GetChildIndex(Control child)
at System.Windows.Forms.ControlCollection.setChildIndex(Control child, Int32 newIndex)
at System.Windows.Forms.Design.ControlOleDragDropHandler.OnInitializeComponent(IComponent comp, Int32 x, Int32 y, Int32 width, Int32 height, Boolean hasLocation, Boolean hasSize)
at System.Windows.Forms.Design.OleDragDropHandler.CreateTool(ToolboxItem tool, Int32 x, Int32 y, Int32 width, Int32 height, Boolean hasLocation, Boolean hasSize)
at System.Windows.Forms.Designs.ParentControlDesigner.CreateToolCore(ToolboxItem tool, Int32 x, Int32 y, Int32 width, Int32 height, Boolean hasLocation, Boolean hasSize)
at System.Windows.Forms.Design.ParentControlDesigner.CreateTool(ToolboxItem tool, Rectangle bounds)
at System.Windows.Forms:Design.ParentControlDesigner.OnMouseDragEnd(Boolean cancel)
sincerely yours,
Matthias Rost
-- modified at 11:28 Sunday 21st May, 2006
|
|
|
|
|
Yes, that explains what's happening. It seems that the framework is handling the end of the drag and drop of the control from the toolbox to your panel, and running into problems because the control it expects to operate on has been deleted.
I recommend posting a message to the panel (when the control is added) which delays the execution of the added control's removal. That way, your control will be removed after the framework has had a chance to complete its normal processing of events.
It would've been nice if ControlEventArgs exposed a bool that you could set to disallow the operation. That would've allowed you to elegantly restrict the type of controls your panel accepts.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Yes, I think you're pretty right...
I will try to maybe catch the Event when dragndrop is ended and then will remove it.
Otherwise I will use a timer as you have proposed.
Thanks for that hint, I should have seen it by my own
greetings,
Matthias Rost
|
|
|
|
|
Subfreq wrote: I will use a timer as you have proposed.
Actually I wasn't suggesting using a timer. I believe you can delay processing of an event (a la Win32 PostMessage() vs. SendMessage() ) by using BeginInvoke() . See this[^] excellent article for more information.
When you've got it work, maybe you can post an article on the subject at CP!
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Ah, I got your idea
Looks very interesting!!!
Thanks for your great help, and yes, if it works very well, I think I will do a little
article (as its really just very small).
Again, thank for your support
Matthias Rost
Edit: It works just perferctly, Thanks, Thanks, Thanks!
-- modified at 12:33 Sunday 21st May, 2006
|
|
|
|
|
Hi,
I'm just starting to use C# after several years of C++ and there are quite a few confusing things.
For ex. if I'd like to write a function that sums two objects for which there is an operator+, how should I do that? I tried to do something like this, but ofcourse it's not correct.
<br />
Object sum(Object a, Object b)<br />
{<br />
return (a.GetType())a+(b.GetType())b;<br />
}<br />
So what it the way things in C# should be written, if it something for one would use templates in C++?
Thanks,
Greg
|
|
|
|
|
You need to know of which type a,b is.
You can check it like this:
if(a is MyType && b is MyType)
{
return (MyType)a + (MyType)b;
}
I'm not sure if the abstract GetType()-way will work.
For templates you might want to take a look at Generics
regards
modified 12-Sep-18 21:01pm.
|
|
|
|