|
.NET is garbage collected. The garbage collector (GC) runs when the application is idle (like when it's minimized) or when memory consumption is high and it'd determined that more memory will be needed soon, or when memory is not available (in some cases). You can force garbage collection by running GC.Collect , but you should not do this in most cases. The GC runs when it needs to and very rarely should you force it (and GC.Collect is a synchronous call, so your thread of execution will block until the GC finishes collecting).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I want to drag a window from one point to other with the help of mouse,is there any built-in event for it or some other method,please help
mughalali
|
|
|
|
|
Overriden MouseDown and MouseMove . In the first one set the variable which indicate mouse button pressed and in second one check if that valiable is true then set the Location propoerty of your form. Then in MouseUp set that variable to false,
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
Hey There!
I'm using the following code to get the free space on my disks:
string[] DriveLetters = {"C:","D:","E:","F:","O:","S:","_Total"};
const int DriveCount = 7;
PerformanceCounter[] DriveSpaceCount = new PerformanceCounter[DriveCount];
float[] FreeSpace = new float[DriveCount];
void ReadFreeDiskSpace()
{
for (int i = 0; i < DriveCount - 1; i++)
{
FreeSpace[i] = DriveSpaceCount[i].NextValue();
}
}
It works once, but the values do not change when I recall the function,
even when the Counter is recreated (DriveSpaceCount[i] = new PerformanceCounter("LogicalDisk","Free Megabytes",DriveLetters[i]); in the loop)
The only way to get new values is to restart the program.
Why?
Thanks in advance.
----------------------
I think war is a dangerous place.
George W. Bush - Washington DC, May 7th 2003
|
|
|
|
|
I think the problem comes from that don't to Close the counter so the resources are not being free.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
Naw...
It doesn't change anything.
What really wonders me is that it doesn't work even when I dispose the Counter and create a new one.
Strange computers....
----------------------
I think war is a dangerous place.
George W. Bush - Washington DC, May 7th 2003
|
|
|
|
|
|
Thanks.
The website doesn't want to work, but thanks for the hint.
----------------------
I think war is a dangerous place.
George W. Bush - Washington DC, May 7th 2003
|
|
|
|
|
In order to make visible a new node in a TreeView, node added at runtime, do I have to repaint again the whole tree (with the BeginUpdate and EndUpdate methods)? Or is there a way to make the new node visible too?
Thank you in advance.
Best regards,
Cristina
|
|
|
|
|
I don't think its needed. Its just using when you want to edit large numbers of nodes.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
Hey guys
I am not a J# guy at all but made the unfortunate mistake of using the J# zip classes in a .NET app of mine The app takes a zip file, strips off certain filtered files and writes a new zip file. The issue is that this new zip file is somehow slightly corrupted. I can't read the app-written zip using my app, but WinZip reads it correctly and can extract it correctly too; but even WinZip cannot do a direct delete of an entry (from within WinZip) - it shows some header corrupt error. I am not sure whether the issue is with the ZipFile constructor (while reading) or with the ZipOutputStream class (while writing).
Google searches tell me that this is a known bug and a Microsoft person's suggested workaround was to extract all files with WinZip and rezip it using WinZip. I almost choked with horror at the very idea that this was even remotely a workaround Gosh! I mean if I could do that using WinZip, then why use these zip classes at all, eh?
Anyway I just wanted to know if there is any hotfix or patch that's ready for fixing this bug? Thanks in advance for any help.
Now with my own blog - void Nish(char* szBlog);
My MVP tips, tricks and essays web site - www.voidnish.com
Request - Could everyone who have in the past, posted on my personal forum on CP, be kind enough to delete all your posts please? I intend to start a personal non-technical blog there, now that it is RSSd and would very much like to empty the forum before I do so - because the posts that are there as of now are mostly test posts and posts that were made before we all knew it was a blog
|
|
|
|
|
Not that I'm aware of but I do have some alternatives for zip libraries.
I've used this one before and it works well.
http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx[^]
I think there is also a paid alternative from XCeed soft
http://www.xceedsoft.com/products/ZipCompL/index.htm[^]
I somehow dont like hotfixes (for obvious reasons it needs to be sent along with your app and made sure that all the clients install it), which is a major pain.
Anyway, I'm very curious why did you even think of J#, you know that you need a redistributable thingy when you touch it.
Regards,
Kannan
|
|
|
|
|
Kannan Kalyanaraman wrote:
I've used this one before and it works well.
http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx[^]
Yup - that's what I am using now. It doesn't work as well as I want it to - but it's fine for my current purposes
Kannan Kalyanaraman wrote:
I think there is also a paid alternative from XCeed soft
http://www.xceedsoft.com/products/ZipCompL/index.htm[^]
Uhm, not looking for pay-ware
Kannan Kalyanaraman wrote:
Anyway, I'm very curious why did you even think of J#, you know that you need a redistributable thingy when you touch it.
This app is for me - to help me when I am editing. I don't intend to distribute it - though maybe I could upload it to the CP tools section for the other editors. It's too simple an app though Just removes unwanted/disallowed files from the zip.
Nish
Now with my own blog - void Nish(char* szBlog);
My MVP tips, tricks and essays web site - www.voidnish.com
Request - Could everyone who have in the past, posted on my personal forum on CP, be kind enough to delete all your posts please? I intend to start a personal non-technical blog there, now that it is RSSd and would very much like to empty the forum before I do so - because the posts that are there as of now are mostly test posts and posts that were made before we all knew it was a blog
|
|
|
|
|
Nishant S wrote:
Yup - that's what I am using now. It doesn't work as well as I want it to - but it's fine for my current purposes
Its based on the zlib impl. so i'm sure its not very friendly in terms of API usability, but its free
As far the paid part I happened to use that in one of my projects when .net was on its initial stage and I think sharpzip was just on its initialstage or was not stable(i dont remember now).
Anyway, didn't know that you are using it for your personal stuff
I'm now having a horrible time with the vs.net ide with some huge no. of projects, it just sucks :
you seemed to have cleaned up most of the stuff from your page, I guess the left overs would be difficult to erase, offcourse you can ask the CP God
Regards,
Kannan
|
|
|
|
|
Kannan Kalyanaraman wrote:
you seemed to have cleaned up most of the stuff from your page, I guess the left overs would be difficult to erase
Yup - the last few are a little tough Dont even know if those people come here any more.
Nish
Now with my own blog - void Nish(char* szBlog);
My MVP tips, tricks and essays web site - www.voidnish.com
Request - Could everyone who have in the past, posted on my personal forum on CP, be kind enough to delete all your posts please? I intend to start a personal non-technical blog there, now that it is RSSd and would very much like to empty the forum before I do so - because the posts that are there as of now are mostly test posts and posts that were made before we all knew it was a blog
|
|
|
|
|
BTW what makes me mad is that there is not even a KB article describing the bug in the zip class library
Nish
Now with my own blog - void Nish(char* szBlog);
My MVP tips, tricks and essays web site - www.voidnish.com
Request - Could everyone who have in the past, posted on my personal forum on CP, be kind enough to delete all your posts please? I intend to start a personal non-technical blog there, now that it is RSSd and would very much like to empty the forum before I do so - because the posts that are there as of now are mostly test posts and posts that were made before we all knew it was a blog
|
|
|
|
|
The .NET FCL 2.0 will include compression streams (at least it does now). Just FYI.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for the info Heath. I am writing a bug-report-article for CP to save others the trouble I went through And I've mentioned this there.
Regards
Nish
Now with my own blog - void Nish(char* szBlog);
My MVP tips, tricks and essays web site - www.voidnish.com
Request - Could everyone who have in the past, posted on my personal forum on CP, be kind enough to delete all your posts please? I intend to start a personal non-technical blog there, now that it is RSSd and would very much like to empty the forum before I do so - because the posts that are there as of now are mostly test posts and posts that were made before we all knew it was a blog
|
|
|
|
|
Hey thats cool, where did you get that info from, I haven't seen this one mentioned anywhere. Any idea if this stuff is in the March CTP drop.
|
|
|
|
|
Because I have the PDC bits of .NET 2.0 and VS.NET 2005 (being an MSDN subscriber).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I made a small bzip2 Managed C++ lib, here on CP. Simple, easy
|
|
|
|
|
That's cool leppie I didn't know about it, else might well have used that one instead. Now I am using SharpZipLib now - the class/method names are compatible with the buggy J# library classes.
BTW I presume you just wrote a wrapper, right? SharpZipLib seems to be fully managed code
Nish
Now with my own blog - void Nish(char* szBlog);
My MVP tips, tricks and essays web site - www.voidnish.com
Request - Could everyone who have in the past, posted on my personal forum on CP, be kind enough to delete all your posts please? I intend to start a personal non-technical blog there, now that it is RSSd and would very much like to empty the forum before I do so - because the posts that are there as of now are mostly test posts and posts that were made before we all knew it was a blog
|
|
|
|
|
Nishant S wrote:
I presume you just wrote a wrapper, right?
Yip, was gonna look into rewriting it in C# but never got around to it
|
|
|
|
|
I've got a Form that I created that has roughly 30 controls that I need to tab through. I set the Tab Index of each control accordingly, but the tab NEVER follows this order. I'm not doing anything fancy to the controls such as handling events. It almost looks like the form is tabbing through the controls in the order which I added them to the form. On a hunch, I even tried rearranging the initialization in the Component Designer Generated code so that they even appeared in the code in the correct order, but this still didn't help. Has anybody else ever had this problem? How can I take care of it? Would appreciate the help! Thanks
|
|
|
|
|
Set the tabindex AFTER you have added the tab page to the tab control
|
|
|
|