i have an application that work with threading.
in load_form event of the form i create an instance a thread object and run it,
now my problem is , i want to kill the thread on another event such as button_click event on this form and i cant do it.
i can not create my thread public, because the number of thread should be create is not certain in my allpication,
how can i do it, please sya me a solution to solve it...
nobody help you...
you have to help you yourself
and this is success way.
The only reliable way to kill a thread is to let the thread terminate normally.
This means you need a way to notify a thread that it needs to terminate, and
provide a way to wait for the thread to terminate if necessary.
There's synchronization objects you can use. For example, EventWaitHandle.
There's no need to "create my thread public", but you may need to keep contexts
to your created threads somewhere, like in a collection in your form class.
I have a problem in downloading .css and script files associated with aspx page on downloading the page page. I have used java script to download the file.
code is :document.execCommand("SaveAs",true,document.title + '.html');
I am wrting an Http client to access some web page. My current network configuration is using proxy of local lab to access internet.
For the URLs which I can not access, I have also tried in IE, both of them are errors from DNS/Bad gateway. Here is the error message in IE.
My questions are,
1. is DNS fail to resolve the domain name to IP address the root cause?
2. If yes, which party is responsible to choose which DNS to use? Proxy will choose which DNS to use or proxy will resolve the name to IP directly?
IE error message,
Error Code 11001: Host not found
Background: This error indicates that the gateway could not find the IP address of the website you are trying to access. This is usually due to a DNS-related error.
Date: 8/2/2008 10:41:38 AM [GMT]
Source: DNS error
HTTP, the protocol which web browsers use to retrieve and display web pages, is different from DNS. I don't think web proxies to DNS resolution - proxies get a resolved address to which they open a HTTP connection.
Here's a quick way to find out who's doing the resolution - Open cmd.exe and type nslookup. Play around with the options there (set d2) and you'll get a lot of information about who's doing the resolution.
m trying to apply sql transaction on many insert command,
the problem that m using multi-tear application and Typed Data Set and i want to do the commet and the rollback on the UI layer ,
so any suggestions are welcomed!
I am using nHibeernate version 1.0.4., which I took from SourceForge.Net with the configuration settings given in the site itself. I am getting the follwing error in Mapping a file. Error Could not find a getter for property 'UN' in class 'Address.Info'
A first chance exception of type 'System.NullReferenceException' occurred in Address.exe
Please find below my code files: PLease replace &lt; with '<' and &gt; with '>'.
The solution depends on how you sort the SpareParts and ServiceTools.
One solution would be to add both collections to a single collection and then sort using a delegate, like this:
private static int CompareStockItems(IStockItem x, IStockItem y)
// add your sorting algorithm here
if (x.StockCode.Length < y.StockCode.Length)
else if (x.StockCode.Length > y.StockCode.Length)
List<IStockItem> items = new List<IStockItem>();
You can also just do items.Sort() without specifying a sorting delegate, then the CompareTo methods of the two classes will be used.
This however depends on the implementation of the CompareTo method. If you want SpareParts only to be compared between themselves and ServiceTools also only between ServiceTools, then both CompareTo methods are likely to be different and you'd have to use a delegate to sort them in the list.
If the comparison is the same for both stock item types though, then you can duplicate the CompareTo method in both implementations and use something like:
public int CompareTo(object obj)
IStockItem item = obj as IStockItem;
if (item == null)
if (this.StockCode.Length < item.StockCode.Length)
else if (this.StockCode.Length > item.StockCode.Length)
for both stock item implementations. I don't recommend this design though, as a change in one implementation needs to be changed in the other accordingly.