|
Well, that's because GetProcessesByName returns an array of Process objects, which is exactly what the error message says. You need to iterate through the array and Kill() on each one.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I dont know how to do that
|
|
|
|
|
I think it would be better if you read a book that teaches basic C# constructs before proceeding any further. You really should know how to loop over an array.
foreach(Process process in Process.GetProcessesByName(...))
{
process.Kill();
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Ahhh. I was, doing something like that. I made a new process (in this case 'tx') then tried to do foreach( Process in...)
Well. Thanks, you've been a great help!
|
|
|
|
|
Hi.. I'm doing a project on C# web application. On one of the part i need to retrieve user list and from there i can select one of the user and do the edit and delete on just the user we have selected. I have manage to retrieve the database of user list but now i was unsure about how can i select just the particular user and do the edit and delete from there.. Anyone, can help me with it? Thankz..
Cheese_kid =p
|
|
|
|
|
Hi there,
Your question is so generall . You need to ask a scpecific question.
Cheese_kid wrote: i need to retrieve user list
where do u retrieve user list? (Database, or just normal file)
if u decide which technology used as ur back-end, so then you should go ahead with some next steps
<< >>
|
|
|
|
|
Hi All,
I wanna get the width and height of a character with font "Arial" or any fonts, do you have any solution for this case ?
Thanks
|
|
|
|
|
The following function will return a SizeF having the width and height that you need...
System.Drawing.Graphics.MeasureString(String, Font)
|
|
|
|
|
hi,
I have to implement transactions in my code, using enterprise services.
I have no idea about it. Could anyone please tell me some links where i could know how to work with it? even sample codes would help
Thank,
Dee
|
|
|
|
|
I'm not experienced with enterprise services, but have you looked at System.Transactions namespace in the .NET 2.0 framework?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Morality Apart from God
Judah Himango
|
|
|
|
|
Enterprise services is simply another name for COM+/MTS.
Basically this wraps all calls to objects within the COM+/MTS container in a transaction. So You write a DLL with a method (or several of course) and put it into COM+. All calls to the DLL will then be wrapped in a DB transaction.
If you look on MSDN for Enterprise services you will find a lot of information on them. It is not really that complex from a development point of view, from what I remember you simply implement an interface or two.
MCSD(VB6/SQL7)
MCAD(C#/SQL2000)
MCSD(C#/SQL2000)
|
|
|
|
|
Hi, I have the following code
Stream stream = File::Open(fileCFDPath, FileMode::Open, FileAccess::Read);
how could I clone the stream into a MemoryStream so I dont have to access again the file?
The reason I´m doing this is that the following constructor closes my stream, and after the XPathDocument ends loading the stream, I need to use it later in the code
XPathDocument doc = new XPathDocument(stream);
Thanks in advance
Isaac B
|
|
|
|
|
FileStream fs = File.Open(...)
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, ...); // read the whole file stream into the buffer
MemoryStream stream = new MemoryStream(buffer);
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Morality Apart from God
Judah Himango
|
|
|
|
|
You could call stream = File::Open(fileCFDPath, FileMode::Open, FileAccess::Read); after you call XPathDocument doc = new XPathDocument(stream); . That would reopen the stream, and you wouldn't incurr the performance hit of reading the entire file several times that you would by reading it into a memory stream:
Read once into MemoryStream.
Read once with XPathDocument.
Read again for your "later use".
|
|
|
|
|
Hi guys.Trying to connect C# and Matlab so I can execute any .m files from my C# program and get result(graphs) in my own user control.Anybody has any idea if its possible.Best regards
|
|
|
|
|
I googled 'matlab C#'. Looks like it's possible.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i do it all the time. There's a library (the one I use) on this site...
except the only way i've been able to figure out how to get the graphs on my form is by taking a screenshot. You might be able to find somehting more cleaver.
/\ |_ E X E GG
-- modified at 4:00 Friday 4th November, 2005
|
|
|
|
|
No I want to access graphs from my C# programm so I can enter my data and the programm imported them to MatLab by turning back graph.
|
|
|
|
|
Added an Icon using Form property window, the icon appears on the top bar of the Form but when you look at the executable (via windows explorer), the file still have the default icon.
Help is greatly appreciated
|
|
|
|
|
The icon you added is only for the form. For the executable you need to change the App.ico file in the project folder. Create a .ico file and rename it as App.ico in the project folder.
This should work.
|
|
|
|
|
Take a look at the optiondialog of your project. There is the option "application symbol". Just choose your icon and your exe will have this icon
André
'A programmer is just a tool which converts caffeine into code'
|
|
|
|
|
Hi,
I got this error when sending out email to multiple receipients:
Exception Details: System.Runtime.InteropServices.COMException: The server rejected one or more recipient addresses. The server response was: 554 Transaction failed
My code works for single receipient.
mail.From = "me@mail.com"
mail.To = "mail1@mail.com;mail2@mail.com"
All email addresses are real.
Why it doesnt work for multiple receipients??
Thanks.
|
|
|
|
|
The mail.CC field is an array, I'd say you need to add each address seperately, and the delimiter is not working.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you. I'll try another way.
|
|
|
|
|
I could be wrong, as I'm not certain if your using the System.Web.Mail.SmtpMail class. If you are, and your "mail" object is a MailMessage, then the .Cc is indeed a string, addresses separated by semicolon. If I am incorrect, and .CC is a string array (string[]), you could populate it like so:
mail.CC = new string[] { "mail1@mail.com", "mail2@mail.com" };
|
|
|
|