|
Hi All,
Please help me to find a way to kill a process(say cmd.exe) running on network machine.
I have admin rights on one machine and I am only able to get the process running on client machine but when i go to kill any of the process i am caught with access denied or action not allowed kind of exceptions. (I think Process class will not serve here)
Please help.
Thanks in advance
vivek
v
|
|
|
|
|
You can't. The account your code is running under must have admin rights to the target machine in order to kill the process. There is no way around this requirement.
|
|
|
|
|
yes I have the admin rights.
please guide me on this.
thanks in advance.
v
|
|
|
|
|
Hi All,
I am able to kill the process on remote machine but sometime i get RPC Server not running/available exception.
Anybody knows how to overcome this problem ?
Thanks in advance
v
|
|
|
|
|
Hey guys
I have a few cool ideas for a chord book app for musicians. The idea behind something like this is pretty basic, you are anchoring chords above text. The problem is that I come from a web background, and I have no clue where to even start with something like that.
What I would like to be able to do is drag an image from a pallet over some text. When it is over the text, I would like something like the text cursor to appear in between individual characters. Once the mouse is released, I would like to display that image anchored over that bit of text (so after dragging a chord, if the user goes to the start of the line and types more, the image will move with the text). I would also like to be able to do some typesetting for printing (to be able to put the chord names in a line above the text, but have it anchored again. simple with monospace, but I want to support not monospace fonts for printing)
I have no clue where to even start looking to make stuff like this. If anyone could point me in the right direction, it would be greatly appreciated.
|
|
|
|
|
To make things easier for yourself, stop thinking about the application as a whole. Pick one aspect, and break it down. For example:
Draging an image.
Click on image, move image, release image.
Events: mouseDown, mouseMove, mouseUp.
On mouseDown, get the picture that is below it.
On mouseMove, draw the picture at the location of the mouse.
On mouseUp, get text that is below image, attack image to text.
...
Then, you break that down:
On mouseDown, get picture.
Add an onClick event to each picture, so that you know which picture has been clicked
...
And so it will go on.
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
Hello, I am new to programming. This will be my second C# programming class. I am very confused on using Visual Studio C# apps. In our class we write C# console apps. I need some help understanding how things are saved and how ro test your code. my example
I start a new project as a C# console app:
I write my code, before I save it I can test the code by going to debug and the code will run. If I have errors it will come up if not the output is shown. Now here comes the part. When I save it I save it as a file and not a project or a solution. It saves but then to totally close the code out I must close the solution. I chose to discard and exit. Now I am able to open up a new project or open up and existing file or project.
Now I need to change some code to my C# file I just wrote and saved. I open it and and it brings it up. Everything is there. I now make some changes. Now I want to test the code. HOW DO I DO THIS.Ths debug menu is not an option. it si not highlighted. What am I doing wrong?? I am saving the code wrong as a file. What do I need to do. I have been having to open the exiting file, copy the code, close that file, open a new project console app and then paste the code in the new window and there I have my debug option nice and highlighted and I am able to test my code that I had to make changes to. I know there is another way. HELP PLEASE. Thanks in advance,Darren
|
|
|
|
|
dxladner wrote: Now I need to change some code to my C# file I just wrote and saved. I open it and and it brings it up. Everything is there. I now make some changes. Now I want to test the code. HOW DO I DO THIS
You do it by NOT doing this:
dxladner wrote: When I save it I save it as a file and not a project or a solution.
You MUST save the entire solution so the entire set of projects, plus all supporting files gets saved.
I have no idea why you would save just the *.cs file and not the entire solution.
|
|
|
|
|
Thanks Dave for the quick reponse. This works great. One other question. Can you elaborate on the solution vs the project vs the differnt files?? or direct me to a link with some good clear explanations.Thanks, Darren
|
|
|
|
|
A solution contains many projects which contains many files. All programs are stored in a project and has many files. Sometimes your application might depend on other code that you want to debug at the same time, so you add both projects into a solution.
I hope that explains the relationship a little.
|
|
|
|
|
Hi,
I have this:
int a = 5;
int *p = a;
Ho can I delete the pointer.
Thank you.
|
|
|
|
|
What do you mean? There's nothing here to "delete". It would appear that you're comming from a C++ background and trying to use pointers the exact same you did before. C# does support pointers, but not to the extent that C++ does.
|
|
|
|
|
Hi,
I use unsafe code - I am able to work with pointers(I think).
|
|
|
|
|
Yeah, with pointers, unsafe code is a given.
You haven't answered anyones questions about what you're trying to do with this.
There is no such thing as "deleting" with a pointer in C#.
|
|
|
|
|
I'm not sure that you need to, C# has that garbage collection thing. Where it clears memory that's not being used every now and then.
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
C# has the garbage collection I agree with you.
But I have to use usafe code. when I turn it on, wil garbage collection still work?
|
|
|
|
|
daavena wrote: But I have to use usafe code. when I turn it on, wil garbage collection still work?
Yes, it will still work. However, remember it is non-deterministic. If you are using pointers into the managed heap you need to make the pointer <a href="http://msdn2.microsoft.com/en-us/library/f58wzh21(VS.80).aspx">fixed</a>[<a href="http://msdn2.microsoft.com/en-us/library/f58wzh21(VS.80).aspx" target="_blank" title="New Window">^</a>] to ensure that garbage collection does not occur on the object you have a pointer to (remember the garbage collection process will also attempt to defragment the heap, so even if the object isn't being collected it may be moved around).
So, once you are finished with your object just ensure it is no longer fixed and allow the managed reference to the memory go out of scope and the garbage collector will get it. If you are encapsulating some piece of native code into a class you may want to look at the IDisposable interface as a way of cleaning up resources when an object of that class is no longer required. This is especially important if the native code did the memory allocation rather than you allocate memory then pass it to the native code.
|
|
|
|
|
C# has the garbage collection I agree with you.
I have to use usafe code, when I turn it on, wil garbage collection still work?
|
|
|
|
|
|
hi (Mouse_OnClick(Object sender,EventArg e))
event i want to display the mouse button which one is been clicked how can i get this...
wasim khan
|
|
|
|
|
MSDN clearly explains it on the Control.Click page... (assuming you use .NET 2.0 or better)
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I've problem, which is when I click my save button inactive textboxes don't get the latest value (set by javascript function) but the value with which they were loaded...
For example I have a textbox with value 5 after pageload then I use my javascript function onblur and it sets textbox value to 2 and I click Save... (or any other button) The textboxvalue is 5! How can I avoid it in the simplest way to get proper values after postback?
Please help.
|
|
|
|
|
Can anybody help? I know that maybe this problem is trivial, but I've searched the net and found only that using javascript might help... accessing hidden field with javascript... If only anybody knew the steps to do it I would be very grateful...
|
|
|
|
|
Hello, everyone.
I'm hoping this is the right place to post my question. I've been looking around on the net for the last couple of hours and haven't found a solution to my problem. (I did learned some new stuff for use in the future). So this is my situation. I have a program that lets the user create a response test using a movie. When I tried to draw on the movie the activeX controller always pushed its way to the front. So I've created a separate form that floats on top of the main form to draw on. The program also has three threads running, the main thread, a timing thread, and a thread that updates the floating form.
My problem is when I try and send a message to the floating form I trip a NullReferenceException. I've checked both the callback and my class, and both look properly initialized. The floating form is also correctly intialized. I've tried everything I could find, but nothing helps. I've included the method and the callback declaration. The floating form is called 'TestViewer' and the 'HOTSPOT' class is one I've created.
Thanks everyone for your help.
(Sorry my code is in C++, but I know most people us C# or VB when programming in .net, and a lot more people frequent this form than the managed C++ one. If needed I can translate it into C#. Feel free to give me an answer in C#. Over the years I've gotten pretty good a translating C# to C++. Thanks.)
delegate System::Void SetDrawActivePanelCallback(HOTSPOT^ hSpot);
private: System::Void SetTestViewDrawActivePanel(HOTSPOT^ hSpot)
{
if(this->TestViewer->InvokeRequired)
{
SetDrawActivePanelCallback^ cb = (gcnew SetDrawActivePanelCallback(this,
&Edit::SetTestViewDrawActivePanel));
try
{
this->Invoke(cb, hSpot);
} // End try
catch(System::NullReferenceException^ e)
{
String^ s = e->ToString();
::MessageBox::Show(s);
} // End catch
} // End if
else
{
System::Windows::Forms::Panel^ panel = hSpot->GetPanel();
this->TestViewer->DrawActivePanel(panel, this->hotspotVisible);
} // End else
} // End SetTestViewDrawActivelPanel
|
|
|
|
|
There is a message board for C++/CLI questions.
|
|
|
|