|
Hi, I have a requirement to display the count of Mails sending...
I have two threads, and when process starts, 2 threads simultaneously start processing and static variable mailcount getting increment.. At the same time, i need a display a mailcount value parallely on window.
when i click on button, i am showing progressbar, and the count be displayed at the progessbar
The count should be display when process is going on...not after completed.
How can we do this using c#?
Code which i written is as follows
private void bw_DoWork(object sender, DoWorkEventArgs e)
{
T1 = new Thread(delegate() { thread1(); });T1.Start();
T2 = new Thread(delegate() { thread2(); });T2.Start();
int iCount = new Random().Next( 20, 50 );
for( int i = 0; i < iCount; i++ )
{
Thread.Sleep(10000);
m_fmProgress.lblDescription.Invoke(
(MethodInvoker) delegate()
{
m_fmProgress.lblDescription.Text = "Processing file " + i.ToString() + " of " + iCount.ToString();
m_fmProgress.progressBar1.Value = Convert.ToInt32( i * ( 100.0 / iCount ) );
}
);
);
}
private void thread1()
{
for (int i = 1; i <= 100; i++)
mailcount = mailcount + 1;
}
private void thread2()
{
for (int i = 1; i <= 100; i++)
mailcount = mailcount + 1;
}
G. Satish
-- modified at 6:09 Tuesday 20th November, 2007
|
|
|
|
|
what does the reg: mean in your thread title? Ive seen this a few times recently
In answer to your question, raise an event every time a mail is sent and listen to the event from all 5 threads and incrememnt a number onscreen.
|
|
|
|
|
I need code for this...... can u send me code...
How to raise and catch an event and how to display
thanks in advance
|
|
|
|
|
I tell you what, you show me the code you've written for the threaded mail sending including where you start each thread and ill show you where to add some code to raise and listen for events?
|
|
|
|
|
J4amieC wrote: what does the reg: mean in your thread title?
Maybe "regarding"
All the best,
Martin
|
|
|
|
|
Martin# wrote: Maybe "regarding"
So totally superfluous then as the subject line means "regarding"
|
|
|
|
|
ROTFLMAO
The entire thread was funny enough and then I got to that and lost it!
|
|
|
|
|
Hi,
Anyway to store multi-line with special character text, "say class contents"??
string code = @"
using System;
namespace namespace1
{
public class class1
{
public static void Main(String[] args)
{
Console.WriteLine(<blink>"</blink>Hello world!"); //The text is terminated once the (") appear as a closure while it's not:(
Console.In.Read();
}
}
}
";
ps. I dont wanna end up using escape characters like \n \"
pss. I guess this rise the question: "How many characters can a string in C# hold??"
Thank you guys
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
1. Instead of ", use "", like
@"Console.Writeline(""Hello World!"")"; 2. It's not related to .NET, but rather the computer architecture. On an x86 system it should be Int32.MaxValue. Also you will probably be out of memory before you reach that size.
|
|
|
|
|
Hey!
I have created a simple class library project where I have added some resx(resource) files and some images in folders.
I need this images to be available to other projects like my winclient, how do I accomplish this? It would be grate it I could use the resx files directly in my winclient project or at least get intelisens on the images.
Any Idé?
|
|
|
|
|
Hello,
Anybody has RC6 algorith in C# language? Or maybe C++ Builder? I need program like HexEnc. I tryed use HexEnc, but in my Visual Studio 2005 was 2 errors.
Please, if anybody have this algorithm in C# or C++ Builder, send it to me: srgteam@gmail.com, i need it very much.
Thank you for all!
Sorry for my English
|
|
|
|
|
Srgteam wrote: I tryed use HexEnc, but in my Visual Studio 2005 was 2 errors.
What are the errors? Without saying what they are, no one can really help you.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Now i have one error
In function CHexView::FormatLine
hexenc_src\hexencview.cpp(182) : error C2679: binary '+=' : no operator found which takes a right-hand operand of type 'BYTE [17]' (or there is no acceptable conversion)
|
|
|
|
|
Dear experts,
I'm working on a desktop application which will get the items list from the web.
For that I create web service and add a reference in .NET. The service is working fine. But Actually what happened I'm having more than 30,000 items on the web and it working fine on my machine because of fast net connection.
But if I have a slow connection then I'm unable to get the items. So I decided to download order in a batch say 3 batches of 10,000.
How I can achieve tat in .net...?
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
If the webservice returns all the items at one go, you are out of luck. I don't see how you can split it into pieces and receive them.
Cheers,
विक्रम
And sleep will come, it comes to us all
And some will fade and some will fall
|
|
|
|
|
I can pass item no from-to in the form of parameters...?
say 1-10000
10001-20000 and so on...
Is their any idea to apply batch processing in .Net. And if one request is failed then 2 must go on ...?
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
If you can pass in a parameter and get only those items, what is your problem? You can just call the webservice in a loop, passing different parameters and receiving the items you want.
Cheers,
विक्रम
And sleep will come, it comes to us all
And some will fade and some will fall
|
|
|
|
|
You are right but actually what happened the server does not allowed multiple connection at one time. And suppose I call web service in loop and loop running 20 times and suppose after 6th iteration some error occurred then I want to continue loop for next iteration. So I want to execute them in a batch process like outlook if send receive success and send fails then user must got one response properly.
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
Hi,
i have to retrive data from database base on text what i enter in the datagrid column[0]...and it display in datagrid
column[1] and column[2]
myexample: when i enter productID in datagrid column[1] ,it can retrive data from database and display in datagrid
column[1] and column[2]...
please give me code or suggestions.
murali krishna
|
|
|
|
|
my idea will be to get the data in a datatable at once. It would remove to-n-fro motion between front and back end.And then you can manually enter the data in the grid depending on the input.
Chaos, panic and disorder - my work here is done.
|
|
|
|
|
edit:solved
((Star)canvas1.Children[starIndex]).IsShowingProduction = true;
or
(canvas1.Children[starIndex] as Star).IsShowingProduction = false;
The Problem is in this syntax:
[code]
canvas1.Children[starIndex].IsShowingProduction = false;
[/code]
I'm getting index like:
[code]
starIndex = canvas1.Children.IndexOf(star);
[/code]
star is a Star and this happends in a foreach loop.
The children are custom controls, each having defined public bool IsShowingProduction field wrapper.
How to access those child's properties in this manner?
Project:
http://files.filefront.com/MyMoOzip/;9083676;/fileinfo.html
-- modified at 5:48 Tuesday 20th November, 2007
|
|
|
|
|
Any good library to produce .exe files during runtime??
Thanks
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
I found it in a good and simple article here
http://www.codeproject.com/csharp/CSharpCompiler.asp
ps. Please, vote the article up for it's a good and simple and it's the guys first contribution in here and the article voting is going down "personally, I find the article helpful and voted 5" we dont wanna lose such contributions do we??
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hello,
I have figured out how to use the filewatcher, and it is very useful, but I would also like to be able to know which program created the file, as well as the user. Is this possible. I have not found any information about finding the program that creates the file yet.
Thank you
|
|
|
|
|
no, it is not possible to getting the user name the file. I have spends a lots of time in it....but there is no root. you can get ower id and access perrsmission using WMI but not the user name that who is accessing it.
|
|
|
|