|
Just some advice for future message posting...
Nick won't see that reply (because you replied to yourself) unless he visits the forum again and looks for this thread.
Further, when you edited your original post to change the title to "SOLVED", you should have put the solution in the original message as well. In a really long thread, very few people will hunt for the "solution" if it's buried deep in the message traffic..45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
No worries, we've all done it! I'm glad you got your bug fixed anyway.
If you can, I would do all threading development on VS2010. The RC is available and includes ( well at least the Ultimate version does ) some very useful new tools. In particular, the concurrency profiler shows you when waits are satisfied and by which thread, which would have been useful in this case.
If you really want to ensure correct code, there is also a CTP of a tool called Chess:
http://research.microsoft.com/en-us/projects/chess/[^]
It systematically explores synchronization interleavings by running tests ( it's a dynamic tool ). It's got a bit of a learning curve and you have to write the right tests, but it's worth it if you are unsure if your program is correct.
Nick----------------------------------
Be excellent to each other
|
|
|
|
|
Hi All,
I want to find how many elements have blank value and the number of that element using LINQ.
I dont want to iterate the array.
Please guy guide me.
Regards,
Sunil G.
|
|
|
|
|
It depends upon what you mean by "blank" but:
String[] foo = { "", "Hello", "", "World", "How", "are", "You", ""};
Console.WriteLine(foo.Count(x=> string.IsNullOrEmpty(x)));
Should give you some idea.
You'll need to change the predicate x=> string.IsNullOrEmpty(x) to suit your needs.Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
Thanks for your quick reply
It prints : 3.
I also want the index of the element.
In this example it is 0,2 and 7..
How is it possible?
Thanking You,
Sunil G.
|
|
|
|
|
Sunil G wrote: How is it possible?
Iteration. Something has to iterate the array, LINQ is just doing that under the covers.Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
"Blank" in what way? Array's don't have "blanks" in them, although an array of type T may contain elements with the value default(T) - is that what you want to find?
If so, you might do this: (!!untested!!)
static int CountEmpty<T>(IEnumerable<T> data)
{
return data.Count((T item) => object.Equals(item, default(T)));
}
Someone will have to iterate the array though, even if you don't do it yourself. Without looking at the whole array you can never know that there are no "blanks" left in the part that you skipped.
Except of course if you keep a count of how many elements of the array you changed from blank to non-blank (minus the ones you changed back to "blank") in the first place.
|
|
|
|
|
Good answer. I'd was thinking of null rather than default(T). Regards,
Rob Philpott.
|
|
|
|
|
I don't like to give up control; so I would write the iteration rather than have Linq do it.
|
|
|
|
|
Its your wish.
|
|
|
|
|
this.comboBox[store_num] = new System.Windows.Forms.ComboBox();
this.comboBox[store_num].FormattingEnabled = true;
this.comboBox[store_num].Location = new System.Drawing.Point(7, box_location );
this.comboBox[store_num].Name = "comboBox" ;
this.comboBox[store_num].Size = new System.Drawing.Size(68, 21);
this.comboBox[store_num].TabIndex = 0;
this.comboBox[store_num].DataSource = storeNameArray;
//
// textBox3
//
this.textBox[store_num] = new System.Windows.Forms.TextBox();
this.textBox[store_num].Location = new System.Drawing.Point(106, box_location);
this.textBox[store_num].Name = "textBox3";
this.textBox[store_num].Size = new System.Drawing.Size(76, 20);
this.textBox[store_num].TabIndex = 1;
priceArray[store_num] = this.textBox[store_num].SelectedText;
panel1.Controls.Add(this.comboBox[store_num]);
panel1.Controls.Add(this.textBox[store_num]);
store_num += 1;
box_location += 20;
I allow the user to add new ComboBoxes everytime they click add item. Now if there are two comboBoxes, when they select an item from the second one, it changes the first one as well. How do I stop that from happening, so each comboBox has there respective selections.
|
|
|
|
|
Since you didn't supply your own BindingNavigator for each combobox, the default navigator is used for all controls on the form.
The solution is easy. Create a BindingSource for each combobox. Set the DataSource property of the BindingSource to the data source you're currently using, then set the combos DataSource to the BindingSource you just created.
ComboBox1 ----> BindingSource1 ----> Data
ComboBox2 ----> BindingSource2 ----> Data
...
|
|
|
|
|
Hi,
using the smtpclient.SendAsync method, I want to know how much byte (or the percentage)
has been sent out of total bytes.
I didn't found a way to get status information from the client.
Is there another way (for example over the sockets interface) to retrieve these missing information
if yes, how ?
Thank you for your time
Frank
|
|
|
|
|
The SmtpClient doesn't report any progress information, so you cannot do what you want using the SmtpClient class. You'll either have to find a 3rd party library that does what you want or write your own SmtpClient class.
|
|
|
|
|
Thank you Dave,
what you say I already know. But please say where to get these process information and how.
Solutions ?
Frank
|
|
|
|
|
Search for 'RFC 821' on Google (to start with.You'll find out there are more RFC's about sending email).
|
|
|
|
|
|
i have already developed a app which will run in two machine and send the screen shot of machine 1 to machine 2 and i am showing the scree shot of machine 1 on the picturebox through a application which is running in machine 2. so now i want to control mouse and keyboard of machine 1 programatically.
so i need concept. i have some idea like whenever i will move my mouse & click on picture box then i will just send some info like mouse move cordinate and click to the app which is running in machine 1. then machine 1 will move the mouse pointer to the location & click according to my info.
but the problem is if i send the mouse cordinate then two machine may have different resolution. in this case how could i handle this situation.
suppose if i send mouse move cordinate and click then how could i place mouse pointer on right object if machine 1 have different resolution.
so please help me with idea & sample code.
thanks in advance.tbhattacharjee
|
|
|
|
|
are use pictuerbox for showing the remotdesktop?
|
|
|
|
|
yes i will use pictuerbox for showing the remotdesktop screen. please help me. tbhattacharjee
|
|
|
|
|
try to set the size of the pictuerbox to the size of remote screen for the first step or you can set it before run the program
|
|
|
|
|
Start by reseaching "VNC". You'll find a bunch of information on it. This is a far more complex task than your post suggests it is.
|
|
|
|
|
I have developed this type of application in a secure remote sytem. if u can send complete application with running steps then only Help you
sushilsaini04@gmail.com
Sr. Soft. Engineer
Vidhya Technologies
|
|
|
|
|
Hello friends.
--------------------
There is a standard command windows as net use.
Is in .net a class working with these commands?.
Example for ping computer in a network there is class Ping.
If there are examples of work with these classes send to me by mail
Thanks all.
--------------------
Yours faithfully Arsen.modified on Wednesday, February 17, 2010 8:19 AM
|
|
|
|
|
1) Try here[^]
2) Don't post your email to any forum unless you really like spam!You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
|
|
|
|