|
Hehe, my hacks was leaning towards invalidating only a specific region, but that would be real bad
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
Good Morning
i have written something to kill a Process based on the Supplied parameter. Here is the Code
I created a Class that will Contain my Function like this
namespace Process_Killer
{
public class Process_Killer
{
public bool FindAndKillProcess(String name)
{
Boolean Bolres = false;
Process clsProcess = new Process();
if (clsProcess.ProcessName.Contains(name))
{
clsProcess.Kill();
Bolres = true;
}
else
{
Bolres = false;
}
return Bolres;
}
}
}
And after that i have a Win App , that will pass the name of the Process and in the kill button am calling the function that i created above like this
Boolean Bolres = false;
String Processname = txtProcessname.Text;
Process_Killer objProcesskiller = new Process_Killer();
Bolres = objProcesskiller.FindAndKillProcess(Processname);
if (Bolres == true)
{
MessageBox.Show("Process Killed", "Process Killer");
}
else
{
MessageBox.Show("Process not Found, Do not include the Process Extension", "Process Killer");
}
And when i run this app , i get the Error
No process is associated with this object.
Thank you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
You are creating a new process, and then checking if it's name is the one you are looking for. It won't be, you just created it.
You need to be using System.Diagnostics.Process.GetProcessesByName(processName); to find the process with the name you want to kill.
Simon
|
|
|
|
|
Thank you it
It worked
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I post this a C# newbie - please bear with me
I have coded a small project in C#, and ran into a problem illustrated in the below minimal project cs file.
CODE
---------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public static int ScanProgress
{
set
{
progressBar1.Value = value; // Error: An object reference is required for the non-static field, method, or property 'WindowsFormsApplication1.Form1.progressBar1' ...
}
}
}
public static class AnotherClass
{
public static void SetScanProgress(int Value)
{
WindowsFormsApplication1.Form1.ScanProgress = 17;
}
}
}
---------------------------------
/CODE
I get the error when I refer to the non-static progress bar in the set method?
I would like to be able to do something like this, to show the progress of a scanner from a callback function, in the main GUI.
Or more general - how do I alter the Main GUI from another class/object?
Thanks,
munk
|
|
|
|
|
You method is static. You cant refer to instance variables.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
I now understand that this can not be done like this.
BUT THEN - how can I access a property of a (design time) component (like a progress bar "bar.Value") on the main form from another class?
This is e.g. to display tha scanning progress of a camera from a camera callback function.
Thanks,
Thanks,
munk
|
|
|
|
|
This is my requirement.
I am allowed to use a DGV (or a List View or some other control that can be used in tabular form).
Then, I have a set of labels/text boxes that are created in runtime according to some data from a DB. Let's say just text tabels.
So I need to drag and drop contents of these run time generated textboxes/labels onto any preferred cell in the DGV (or that any other control). When that is done, I need to be able to delete/destroy the original label as well.
On the other hand, if the user decides to take some data from the DGV and put them back in the original labels, that should also be possible. SO I guess those labels/textboxes need to be put inside of some kind of a control.
But I'm relatively new to C#, so haven't got much of an idea so as to how to do this. I could get text on labels to be copied to another lables, but when I used a DGV I got stuck.
Main reason being, when an item is dragged onto the DGV, there seems to be no event to detect on which cell the mouse is. The Mouse_Enter method works only for simple mouse enter movements - not when dragging.
PLEASE HELP!
|
|
|
|
|
hi friends
can i create Iphone application in .NetFrameWork? i want application similar to Device application of PDA. any link about tutorial site and Sample Source Code.
I search a lot but there is sample about web application i did not get any help about Iphone application which install on Iphone.
Note: i knew this is wrong forum for this Question but just say Sorry.
I also Knew One another Answere Google but i try too much???
wasim khan
|
|
|
|
|
I doubt you can use the .NET Framework on the iPhone. You'd have to use C or Java I'm guessing.
Have a word with Christian Graus, or maybe not , he's been writing iPhone applications and hating every minute of it.
|
|
|
|
|
Ok Thanx about ur kind replay i will contact CG
wasim khan
|
|
|
|
|
I believe that the standard language is Objective C[^].
Although, like Ed said, I'm sure you'll be able to use Java. (I remember reading about Sun saying they were writing a JVM for the IPhone a few months ago)
Good luck though, I've only heard complaints about it being awkward to do. (Mainly from CG)
Simon
|
|
|
|
|
Hello world!
How to change my Local IP, default gateway, Preferred DNS server, Alternate DNS server with C# codes?
TanX World...
if(Human.live)
{
Human.peaceful = false;
while(true)
{
Human.love(Human girl, Human Boy);
}
}
|
|
|
|
|
|
How to Implement Context-Sensitive Help in .NET Applications Created with C#,
|
|
|
|
|
|
i'm just wondering if there is a straight-forward xmlrpc library in the .net compact framework and if so, anybody has any experience with it?
thnx
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
I think this library[^] is about as basic as it gets from what I remember (without writing your own).
|
|
|
|
|
Hi,
I'm currently developing a c# windows application program which allows me to crop certain part of the image when i select it. But if I got a bigger image than the currently picturebox height and width(e.g. picturebox size(400,300) Image opened size(700,300), I tried to use the StretchedImage property to make it fit into the picturebox but when i crop it crops the original size of the image not the image in the picturebox when I use
Bitmap previewImg = newImg.Clone(rect, initialImg.PixelFormat);
my rect is the rectangle that i selected using Mouse Down and Mouse Up events. Hope I could get some help on this thanks =)..
|
|
|
|
|
I get the following error message when trying to setup 1000s of tables and a list of these tables in an SQL table.
//err.Message = "Microsoft SQL Native Client: Not enough storage is available to complete this operation."
I then have to stop and restart the program about 5 times to complete the operation. Is there anything I can do to bypass restarting the program. It doesn't appear that I am running out of memory (from a separate program which monitors my memory).
Any clues / suggestions.
Michael
|
|
|
|
|
MAW30 wrote: 1000s of tables
Are you disposing all the objects you are using? Most of the ADo.NET classes has a Dispose method. Calling that when you finished using it will release the unmanaged resources immediatly.
|
|
|
|
|
Are you running out of disk space for your SQL Server file system?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Can we do following?
Class A
{
string SomeValue
{
get {return "test";}
}
[someAttribute(SomeValue)]
string someMethod()
{
...
}
}
If not, any thoughts how to achieve it? Basically i want to pass the value of Property as parameter to Attribute.
Thanks.
modified on Monday, October 20, 2008 7:48 PM
|
|
|
|
|
Attributes are determined at compile time so cannot contain a run time value.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
Thanks, is there a way to achieve it?
|
|
|
|