|
thans for the reply,
i thought that after i posted, as i tried it on a folder and watched the count go up.
i just optimised my recursion and its working quite well now, it seems to beat the windows effort for the same folder on the same machine and i'm generating the tree for the structure as well. maybe windows is doing some indexing on the first size check as the next time you do it, it is faster.
thanx again,
g00fy
|
|
|
|
|
The reason it's faster on the second go, is that the most of the clusters containing the directory information is still in the disk cache. On the first go all the clusters has to be retrieved from the disk.
---
b { font-weight: normal; }
|
|
|
|
|
hi
I'm a complete learner about c# programming,I need some source code with the algorithm of case-based resoning.
pls help me
thanks in advance
|
|
|
|
|
Hi,
You need what is called a "switch" statement for "case based reasoning".
I would give you some code but what you are asking is so fundamental to almost any programming language
that I would suggest that you consult the MSDN help or any C# text (only so you really understand what you are doing). In addition,"case based reasoning (as you call it) is found in C, C++ C# etc..
so if you are looking for an easy way out you are cheating yourself
hope this helps.....
|
|
|
|
|
|
Hello again everyone. I am working on this project, and when the user clicks submit, while the page is loading to another page, I want that button to be disabled. I tried just going
<br />
<br />
Submit_Button.Enabled=false;<br />
but that didnt work while the page was loading, it only worked after a post back. Is there a way to immediately make it disabled after the user clicks it before it posts back while the page is loading?
|
|
|
|
|
Use javascript to disable it. As you disable the button you might need to post the form using javascript also, as you can't post a form using a disabled button.
---
b { font-weight: normal; }
|
|
|
|
|
I received lots of help last night trying to get text validated. Problem now is I can't "click out" of the 1st TextBox to the next one or close down the App. What to do?
private void textComplex_1Real_Validating(object sender, System.ComponentModel.CancelEventArgs e)
{
TextBox textBox1 = sender as TextBox;
if(textBox1 == null)
return;
if(textBox1.TextLength == 0)
return;
bool error = false;
try
{
cmplxValue1.Real = Convert.ToDouble(textComplex_1Real.Text);
//cmplxValue1.Imaginary = Convert.ToDouble(textComplex_1Imaginary.Text);
//this would be the next TextBox to validate
}
catch(Exception ex)
{
error = true;
}
finally
{
if(error)
MessageBox.Show("Error");
textBox1.SelectAll();
textBox1.Focus();
e.Cancel = true;
}
}
|
|
|
|
|
Hi,
I did not get what actually you are trying
to do.
Please could you specify what u want to achieve...
Regards,
Pramod
|
|
|
|
|
|
Instead of locking the user inside the textbox until it validates, do something else to show that the data in the textbox is wrong, like changing it's background color, and disable the ability to go further to use the text in the textbox (e.g. the next/send/submit/ok button).
---
b { font-weight: normal; }
|
|
|
|
|
i m working on my study project. i divided that in different modules, now i need to call one module from another module.
|
|
|
|
|
You're going to have to supply ALOT more information than that. What do you want to call, specifically? Some code snippets might help too.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
simply the person wants to open an exe file from the C#.
|
|
|
|
|
|
The way you asked the question, "module" could mean anything. In this case, another .EXE was the last thing I would have guessed. I was thinking maybe something in a referenced .DLL, or trying to call a method in a class, or maybe something in another namespace, ...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
What are all the way to play an .avi file in my application other these:
Video object of Direct Show
mciSendString (c++ for c#)
using windows media player COM
|
|
|
|
|
Hello all,
I need to prevent user from closing the form if he modify any field and ask him if want save or not?
Please help
Thanks
hay
|
|
|
|
|
Hi.
Take a look on the FormClosing-Event. With e.Cancel in the EventArgs e you can prevent the user from clsoing the Form.
|
|
|
|
|
Hi...
I'm writing a Windows Service in C# that when started opens a socket (Listening Port) that reads ethernet frames, inspects the payload, and logs to a DB certain data within the payload. Obviously I want the frames to be processed at a speed that doesnt' cause any lost packets.
So, do I create a thread for each received frame, to keep the main thread from
being blocked? Do I use a thread pool manager? What's the best design for processing the frames in real-time or close to real-time as possible?
Any suggestions/code snippets would be greatly appreciated.
Thanks,
Tom
thomas.paluzzi@havensolutionsgroup.com
|
|
|
|
|
I am new to object oriented. With classes and objects, what is the equivalent for global varialbe. Suppose I have different forms...each forms has its own class.
If I want to decalre a variable that is common to all forms, so that I can change and retrieve the value of that variable in any form I want, how do I do that.
Thanks.
|
|
|
|
|
In C# declare the variable as a static member of one of the classes. It can be accessed by classname.variable name in the other classes.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
A much better way would be to pass the variable to each form as opposed to decalring it as global. For several "global" types declare a class and pass it to each form.
|
|
|
|
|
Hi,
I have a base Form and a base TextBox control. I have derived my Form and TextBox control from the base classes. In the base class of form, I am adding EventHandler for TextChanged Event of TextBox to do some generic operation like setting dirty flag. And again in the Derived View I am using TextChanged Event of TextBox Control to enable/disable the OK button. I am opening the form in Modal form. When I close the Form, it is not getting cleanup from memory. I checked it in .NET Profiler. In the profiler it is showing me that TextChanged EventHandler is still referring the Form. I want to cleanup all EventHandlers on Closed event of the Form. Pls let me know how I can cleanup all EventHandlers for all Controls in the Form. IT IS URGENT. Please let me know.
|
|
|
|
|
If you're showing the form by calling it's .ShowDialog() method, you MUST call .Dispose() on it when you're done with it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|