|
asator wrote: is it a bug in .net or did i not read something correctly?
Impossible to say without knowing what your program does.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
well it does make alot of httpwebrequests, operate on alot of strings(retreive data from the response, alot of string.substring and string.indexof calls)
i think it has something to do with one of these...
ps. i noticed in a memory profiler that the program has 112k string instances...wtf?
|
|
|
|
|
Try closing the HttpWebResponse s after you finished retrieval of data and try to minimize use of SubString as each return value is a new string object. Maybe you can use regular expression to be more efficient but it depends on what exactly you are doing.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
1. what do you mean by closing?
2. here is an example of what i am doing:
strX[i] = strX[i].Substring(strX[i].IndexOf("href="));
strX[i] = strX[i].Substring(strX[i].IndexOf("ht"));
strX[i] = strX[i].Replace("amp;", "");
there is much more of this and this is in a for loop with about 100 loops... so now i know how i got to 112k string objects...
so can i do what i am doing in a better way?(i mean the substring issue)
|
|
|
|
|
1. By closing I mean calling its Close method[^].
2. As said before you may be able to get rid of some SubString calls by using regular expressions.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
1. ok so all my httpwebresponses close
2. what do you mean by regular expresions?
3. thank you for your help
|
|
|
|
|
i would also like to ask another question, can i somehow 'call' the Form.Minimize method without the 'visual' efects? i mean something like simulating the minimze method in order to free the memory? maybe someone knows what is called when the form is minimzed?
|
|
|
|
|
asator wrote: once i open the program it will keep on draing more memory, it will never stop
So if you do not minimize do you get a Sytem Out Of Memory Exception?
|
|
|
|
|
i myself didnt get to the no memory state but alot of users(esspecially the ones with low amount of memory, 128mb and below), they report that after a long period of time, usally over 24h their system 'hangs', 'freezes', so no - there is no exception thrown
|
|
|
|
|
|
Friends please send codes.
Jeya chandran
|
|
|
|
|
|
Hi Friends,
Does anyone know how to
Creat a console application which will be able to
create new accounts (with account name ,number and initial balance),
It should be possible to view all accounts and see the name, number and current balance??
|
|
|
|
|
samaan82 wrote: Does anyone know
I am sure alot of people know, but I somehow think this simple task has been given to you to complete.
|
|
|
|
|
|
Hi,
Does anyone know how to add all the namespaces in "System" to a dropdownlist
EG:
System.Data
System.IO
System.Text
- I want all these names to display in a dropdownlist.
|
|
|
|
|
Write them all out, Ctrl + C, Ctrl + V,
or modify you default C# template
|
|
|
|
|
leppie wrote: Write them all out, Ctrl + C, Ctrl + V,
OK, if you have enough time, why dont u do it for me?
I need to add it dynamically, as the application does not stop there.
|
|
|
|
|
playout wrote: why dont u do it for me?
He probably will, if you pay enough
playout wrote: I need to add it dynamically
This won't be easy. The only way I can think of is using reflection to iterate over all types declared in your and all referenced assembly, retrive their namespace and add it to the list if it isn't present yet. Of course this will lnly give you the namespaces of types declared or referenced by your app. So maybe the copy-and-paste thing isn't that bad.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi everybody !!!
My app have a module : Search Infos in Text File
+ Insert Text File to Database
+ Search strings in Text File
I need some code to build app, thanks !!!
-- modified at 9:05 Monday 2nd October, 2006
|
|
|
|
|
Hi guys
Where do I find a list of database error type exceptions for SQLServer 2005? I'll know when its a database error a and log it in the eventviewer and send an email. I just want to distinguish between database errors and any other error.
thanks
|
|
|
|
|
honeyman_can wrote: Where do I find a list of database error type exceptions for SQLServer 2005?
Ask the database itself: select * from sysmessages
|
|
|
|
|
Hi,
I can current move the cursor to the position by doing in a c# application:
Cursor.Position = new Point(Cursor.Position.X - 0, Cursor.Position.Y - 80);
However, if i run the above codes in a C application, it will give errors. I am developing a C application which is compile and run by using visual studio.net 2005, i cannot add the "using System.Windows.Forms;" to the C application too.
Is there any other method they can perform the above cursor.position function in a C application?
A short sample of the coding:
#include "cv.h"
#include "highgui.h"
#include <ctype.h>
#ifdef _EiC
#define WIN32
#endif
using namespace System::Windows::Forms; <--- when i try to add the namespace, the program have alot of error upon compilation
static CvMemStorage* storage = 0;
static CvHaarClassifierCascade* cascade = 0;
void detect_and_draw( IplImage* image );
Errors Encounter:
error C2061: syntax error : identifier 'namespace'
error C2143: syntax error : ';'
error C2143: syntax error : missing '{' before ':'
error C2059: syntax error: ':'
I can't figure out the problems behind. Can anyone help?
Thanks
Jas
|
|
|
|
|
You can't use C# code in a C program.
You can either wrap your C code into a dll and call it via DllImport from the C# project, or you might want to use C++/CLI.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi,
The C program is the main executable file, the codes in c# is the function i would like to call. Can i compile the C# into a dll and use it in the C program?
As i have not use the VC++.net before, do you have any idea whats the difference between the MFC, Win 32 or window Form. I wish to build a GUI, and some of my frds mention that i can use the MFC as it has the auto drag and drop toolbox, but i found out recently that VC++ window form also has this properties.
Sorry for the trouble
thanks alot
jas
|
|
|
|