Answer Questions
dakerson Is there any way to implement an application that close other running application???
help me if there is any way to implement an application that close other running application... thanks in advance.. Take a Look at the System.Diagnostic.Process Class. e.g. Process p=Process.GetProcessByName("windord.exe"); p.Kill(); rizwan>>>>the same error ... array does not contain definition for kill I think you did not understand me well MY application should to close other applications ... this is the situation .. In my server there are not less than 120 to 150 application running at the same time .. so everyday I try to keep the high performance by restart the server twice aday .. a ...Show All
Vinodonly extracting data from comma delimited string
hi, im using c#, have a comma delimited string and i wish to split it. string example is: john smith, freddy, mark/,jones, john i don't wish to split where a comma is backslashed. any ideas thanks. andrej, your latest code gives me this: john/,smith becomes john/ roger/,wilco becomes roger/ Any ideas Ok, so '/,' is not the splitter... Try this: string pattern = "\\s*( <=[^/]),\\s*" ; Andrej You're probably using .NET framework 1.x then... You can try without it, but the result would include empty array items... I'll look into your regex expression... Andrej Sorry folks for multi posts, server kept ...Show All
neogortex How to check if an instance was created alrady.
Hi, How to check if an instance was created already. Ex: If I create an instance and than i f I try to create another instance, it will check if it was created already than display an error message. Thank you, Hi, a pattern in software is typically is referred to as a Design Pattern. These are patterns that come up over and over again in software. Like in other disciplines such as building a bridge there are certain patterns you can use to build a bridge, a supsension bridge, an arch bridge etc the same is for software, such as wanting a single instance of a type. For examples of design patterns see:http://www.dofactory.com/Default.aspx For the cache and application a ...Show All
Vladimir Chtepa Directory.Exists SUCKS!
Alright so I am trying to detect if a directory named "C:\\A&B" exists and low and behold, Directory.Exists will not work. Why you ask Well, when I step through the code it changes the string's value to "C:\\AB". Apparently Microsoft thought it would be a good idea to just remove any abnormal characters. To work around this, I just get the directories last modified time and if it exists it returns something otherwise it throws and exception. How do I just discard this IOException The line: Console.WriteLine(System.IO.Directory.Exists(" C:\\A&B ")); works perfectly fine for me. (I've tried it both with & without the directory existing) Where is it removing the "&" (N ...Show All
binod m paul c# how to call functions
I have been converting a c++ program into c#. I am using Windows Application. I have a basic structure now for C# all through my program. Except I think I have it all wrong. The program compiles on the first pass, and on the second pass all my functions are flagged with an error. namespace WindowsApplication1 { using System; using System.Windows.Forms; public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load( object sender, EventArgs e) { } } } public class MainBegin { public static int mainbeginstart { get { read_hotspace_file ; <------ function read_garage_fil ...Show All
Dee-roc VS2005 IDE Crash!
Hi folks! I have an "interesting" problem with the IDE of VS2005 which crashes with no warning or error messages! Below I send info from my PC. The crash happens very often (every 15min) but I have not seen a pattern yet that causes the crash. It happens when I do simple things like clicking at the IDE's menus. I run WinXP SP2 and develop asp.net solutions in C#. I heard that there is a SP for VS2005 but it is still in beta phase and I am a bit reluctunt to install it. I know all of the info below is overwhelming... if you have time please let me know what I can we do to solve this crash. Thanks in advance! George I. Below is my system information: Microsoft Visual Studio 2005 Version 8.0.50727.42 (RTM.050727 ...Show All
barkingdog Window Hook?
Hello, I know you can create window, message, mouse hooks and such but is it possible to do some sort of window hook that can notify my program whenever a window is moved or created Thanks, I looked through it but i'm still not sure which hook I need to use for what i'm trying to achieve. This tutorial seems to mainly focus on mouse/keyboard hooks. Are there any examples more similar to what i'm trying to do See This: http://www.codeproject.com/csharp/globalsystemhook.asp Best Regards, Rizwan For window creation google CBT hook. Thanks, from what i've read, a window hook isn't possible using C# alone. It seems to require creating a DLL in C++. I'v ...Show All
faraaz_malak_c92eb4 how to delete a row in both listbox and database
Hi every body I have a table in sql server2000 database with 2 field table1(id integer primary key, name char(10)); then I load this table into dataset and show it by a listbox ( the list box has only field " name" ) My problem now that I dont know how to delete a record in database when I click a row in my listbox and click button "Delete"; Could you give me an advice in this problem thank you very much. DongMT HI; This is handles by the Button Click event. In the method create a SqlConnection Object and a SqlCommand object where you can specify either a stored procedure or a text command for the sql deletion. Pass the required parameters to the stored procedure or build the text ...Show All
AndyJ_PS how to associate a filetype with a windows service
suppose i have a custom file format with an extension. how do i associate that file extension with a windows service. suppose when i click on the file with particular extension '.dmz', the particular windows service is automatically invoked. should i use filesystem watcher component. thanks for reading! I don't think it would be wise to try something like you describe: if you were to interfere with the opening of a file, you would also block any attempt to read the file (for instance to perform a copy) in conditions in which you might not be able to respond to a dialog box. If you are using a special extension, I guess you are also writing an application that handles those files. If so, the credentials should be asked directly b ...Show All
TBing Sending emails from my application - Not working
Hi, <code snippet> public static void SendEmail() { string MSGBody = "My Message"; string MSGSubject = "My Subject"; SmtpClient smtpClient = new SmtpClient("localhost"); // OR use the following line instead //SmtpClient smtpClient = new SmtpClient("my email client"); string AddressFrom = "me@myemailaddress.com"; string AddressTo = " them@theiremailaddress.com "; MailMessage mailMessage = new MailMessage(AddressFrom, AddressTo, MSGSubject, MSGBody); smtpClient.Send(mailMessage); } </code snippet> The above code works fine from my development environment whether I set the SmtpClient to localhost or my actual ...Show All
Juan Carlos Trimi&#241;o IEnumerable problem
Hi, I have a problem compiling the following code. The error I get is: 'Ch12Exercise05.ShortCollection<T>' does not implement interface member 'System.Collections.IEnumerable.GetEnumerator()'. 'Ch12Exercise05.ShortCollection<T>.GetEnumerator()' is either static, not public, or has the wrong return type. C:\BegVCSharp\Chapter12\Ch12Exercise05\Ch12Exercise05\ShortCollection.cs Can someone help me Thanks, Alex. { public class ShortCollection <T> : IList <T> { protected Collection <T> innerCollection; protected int maxSize = 10; public ShortCollection() : this (10) { } public ShortCollection( int size) { maxSize = size; innerCollection = new Collection ...Show All
JulianRidley Getting started with Business objects
Hi guys, i m trying to get started with Business Objects, but i m a little bit lost here.. hope you guys can help me out. So far all the tutorials i read on the internet just show you how to make an "employee" or a "product" class, coding that is very simple, and i don’t have any problems using them and even binding them to Windows Forms using BindingLins<T>, etc... i ve been testing it out and it works fine. But right now i m trying to make something that have some relations, and i cant figure out how i am supposed to do it, what i m trying to do is a simple "Order" class that is related with a customer and some products... something like: Order Customer Products So, could you guys help me out with this ...Show All
Spider-link networkstream eventhandler
can anyone help me or advice me I am making an application whereby actions are done according to what is read from networkstream. considering that my application is quite big, i wanna reduce threads and one that i see can be reduced is the thread for scanning of data available in the networkstream. what i am thinking of is somekind of eventhandler whereby if there's a networkstream.dataAvailable then it will execute. here's what i did, private void OtherCode() { thread = new Thread(new ThreadStart(wait_for_commands)); thread.Start(); thread.Priority = ThreadPriority.Normal; } &nb ...Show All
Sheng Jiang &#40;&#33931;&#26207;&#41; How do you REMOVE or DELETE Items from Recent Projects list in VS2005 RC?
I have been testing VS2005 RC and as a result, I have built many applications. Most I am no longer interested in or use and would like to DELETE them from the RECENT Projects list, but I dont see how ! I have been achieving this by manualy deleting the project from IIS, but there's got to be a better way ! Any ideas cheers, yousaid >> The suggested solution is to have a "clear recent projects history" button on the start page. uhm, maybe I am blind, but in the released version I have still not found an easy way to cleanup your "recent projects" list. I also believe that the way that the list is presented makes people want to be able to mange it. E.g. in office (and ma ...Show All
Le Saint Windows service controller
Hi, I am created a windows service. I install it with the acount property set to "localservice". i also created a gui that controls the service. I can start and stop it fine but the problem when executing a custom command i get and error "Cannot open SeekWare service on computer '.' " SeekWare is the service name. Someone told me that he fixed this problem by installing with the acount property set to "User" . But i want the service to run no mater which user is logged on. Thanks. A custom command must be in the range of 128-255. If you try to send outside that range I believe you'll get the error you specified. Michael Taylor - 12/1/06 ...Show All
