|
|
Perhaps you would be better off in the ASP.NET forum?
|
|
|
|
|
Hi,
I have developed an application in C# .Net... My requirement is that the application should clean up all the resources that it used and exit when I click on the "Exit" option that I have provided.. But sometimes, when I try to exit the application using "Application.Exit()", the application fails to exit and continues to be listed on the Windows processes in the task manager. I would like to know if I can use Process.GetCurrentProcess().Kill() instead of Application.Exit(). If not, please suggest on what I can do to have the application exit when I want it to...
Thanks,
ramz_g
|
|
|
|
|
Think about what you've just asked. Then give the answer you think most appropriate.
Have you thought about - God forbid - finding what is still running? The technique is part of the leet skilz called 'debugging'
[added]
try
Application = null;
Panic, Chaos, Destruction.
My work here is done.
modified on Wednesday, October 7, 2009 11:11 AM
|
|
|
|
|
Nagy Vilmos wrote: Think about what you've just asked. Then give the answer you think most appropriate.
Nah. If we all replied like that, CP would go belly up.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Obviously it would be potentially dangerous given the function of your application. Imagine if you terminate the process unexpectedly while it is writing to a database or file? You could do damage with this method.
|
|
|
|
|
then you have either infinitive loop or another thread running.
Also when exiting Garbage Collection cleans everything.
When using Kill() is only for last resort when programs stopped responding. To prevent that happening, code it so that it will not happen. If you use all data will be lost, so don't use it. Find a bug and fix it
|
|
|
|
|
Safe? Sure, but stupid. Even Application.Exit() should be unnecessary; I've never used it and I don't see why it would ever be required.
|
|
|
|
|
Hi All,
Thanks for all your replies...
@Nagy Vilmos,
Yes Nagy, I did think about what could be running.. It is just that I was not able to find what was running.. Debugging? Of course.. Anyways, thanks for your reply...
|
|
|
|
|
How can I find which table is bound to a textBox please?
|
|
|
|
|
This appears to be a strange question. It might, of course, make perfect sense to you but seems strange to me.
If it is your TextBox you should be aware of this already.
If it is not yours, it smells a little like hacking. That is not necessarily a bad thing but if you could explain why you need to do this it would help people to give a sensible answer.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
No hacking. No excitement here
My application contains several texboxes which are databound to table(s) containing date fields. The users have a habit of putting dates into the wrong textboxes (Grrrr!!) and then trying to correct the error(s) by attempting to have a blank (null) textbox via the backspace key. The system won't allow this.
So, I am trying to create a function which
a) understands which textbox it is checking
b) locates the correct table databound to that textbox (my question)
c) sets the associated table row field to System.DBNull.Value in order for my application to be satisfied with the user's correction.
Hope that makes more sense.
My apologies for the curt original question. I always assume that all coders are part of the Borg collective He he.
|
|
|
|
|
Each control has a DataBindings collection. So you can do something like:
Binding bookBinding = this.txtBookingDate.DataBindings["Text"]
Amazingly enough you then have a Binding instance (bookBinding ) that has properties like DataSource , BindingMemberInfo and others that might be useful.
Hope that this helps.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I'm working on a utility that reads files and gets the 'words'. It's a sort of indexing project that I'm working on. I've got a lot of formats covered but there are a few formats - like pdf and doc - that I am having trouble with. So as I'm playing in C# I'll ask here.
Has anyone tried to mine the text from these formats and if so was it possible without an intermidary file? Ideally I would like to be able pass the file into a StreamReader derived class and read the text out of the other end.
Any idea guys and gals?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
|
From that one word, I have an article, a web-site and a solution
Thanks totally, you will be mentioned should this make it to an article; in 5-6 time...
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
You are welcome
|
|
|
|
|
To interact or read for a doc file (MSWORD) you would have to reference the microsoft PIA (primary interop assemblies) to interact with a word file, that includes reading and writing.
|
|
|
|
|
how to pass the data from form 1 going to form 2??
|
|
|
|
|
|
you can use public static global variable in first forms class (For example form1) and can access that data from next class by(form1.variablename).
Another way can be:
overload the constructor for form2 with paramater and create object of form2 with parameter from form1
|
|
|
|
|
dokhinahaoa wrote: you can use public static global variable in first forms class (For example form1) and can access that data from next class by(form1.variablename).
Never ever suggest that! It is very bad practice to do this: fro example what happens if you need two instances of form2 with different parameters? Rmember we get a lot of beginners reading this forum - we do not want them getting the idea that this is something you should do in the real world!
Either pass parameters via the second form constructor, or use events to pass / pick up the data.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi Guys,
Please could someone assist me...
I am trying to extract the text placed between i love puppies using regex.
I have html in a variable and i am trying to establish whether an anchor tag exists in this string that contains "i love puppies" or if need be "love puppies".
I have attempted to using this
MatchCollection mAnchor = Regex.Matches(originalStr, @"(<a[^>]*> ('text'[^<]*) </a>)*", RegexOptions.IgnoreCase);
but due to my lack of deeper understanding of regex...i have not been successful...
Thank you in advance,
Butch
|
|
|
|
|
Are "love puppies" a pseudonym? Never, mind I don't want to know...
Try Expresso [^]- examines and generates Regular expressions. I use it all the time for regex creation. It also has a small library which may help.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
We would need to see examples of the text you are trying to parse.
|
|
|
|