Click here to Skip to main content
15,347,000 members

Comments by HaBiX (Top 22 by date)

HaBiX 19-May-14 5:03am View
Reason for my vote of 5 \n Useful, but why pass datetime argument as string?
HaBiX 19-Mar-14 17:32pm View
Reason for my vote of 2 \n Where is ASP.NET? I only see html
HaBiX 7-Jan-14 6:02am View
Reason for my vote of 1 \n This is not how you prevent sql injection attacks. Did you ever hear about SqlDataParameter?
HaBiX 8-Aug-13 1:36am View
Reason for my vote of 1 \n It does not work.
1. You can right click back button and select any point in history
2. If you pick a location in history that was a result of a postback, you'll get asked to resubmit again
HaBiX 4-Aug-13 9:45am View
Reason for my vote of 3 \n 1. It lacks explanation of what is hapening in your code.
2. Having few ints on viewstate (to keep track of page nr., sort field and sort direction) is not a expensive at all.
3. Both methods don't work well with bookmarks - i always use querystring parameter to specify those 3 arguments
HaBiX 19-Jul-13 12:36pm View
Reason for my vote of 5 \n Its a nice solution, but a better one would be to use crc (hash) of javascript content as querystring parameter. This way, if version changes, and this script doesn't it stays in cache :)
HaBiX 8-Jul-13 14:08pm View
Reason for my vote of 1 \n This is just a code dump.. Where is the article?
HaBiX 9-Feb-12 6:11am View
You could lower the FPS at which you're "recording".. Add a "Thread.Sleep(500)" after saving image (this way, your program will sleep 0.5 seconds after capture, giving cpu to other processes at that time)

Note: you'll be recording at 2 frames per second
HaBiX 8-Feb-12 16:07pm View
You're trying to hold all of the pictures in the memory (Bitmap[] bit = new Bitmap[200000000]) - because of this, you'll get out of memory eventually. Its better to save the picture to disk right after grabbing it from screen.

After using Bitmap and Graphics object, call Dispose method to free up the memory, or even better use the "using" keyword, this way, Dispose gets called automatically, when the code goes out of the using block:

using (var b = new Bitmap(w,h)) {
using (var g = Graphics.FromImage(b) {
..... get image
..... save image
HaBiX 6-Feb-12 6:58am View
If you get 100% cpu usage, that is good, means you can utilize all of the cpu's power, but in your case, you took the wrong way to record a screen. Saving pictures over clipboard is not very efficient.

In your solution memory usage gets high, coz you dont dispose any objects.
HaBiX 6-Feb-12 6:49am View
Why not rewrite the code .net? You'll get the best performance possible.. and java vs c# syntax is pretty similar
HaBiX 17-Jan-12 3:26am View
character replacement is possible in html with the help of javascript:

function test(stringIn) {
return stringIn.replace('W', 'H');
alert(test('Wello world'));
HaBiX 13-Jan-12 4:46am View
What i suggested will help determine if the problem is with "\r\n" / Envioroment.NewLine or somewhere else in his project.

Its not meant as permanent fix, but a bug finder..
HaBiX 13-Jan-12 3:47am View
Regional settings usually change decimal number characters, date formats, etc etc (possibly even Envioroment.NewLine). But if "\r\n" didnt help neither will regional settings (you can find them in control panel).

I'm guessing you have bug somewhere else:

- make a simple test table in database (1 varchar column)
- from .net insert string "test\r\ntest" into db (no replacing)
- create a new simple report with 1 filed (can grow), with datasource pointing to test table
- view report / export

- if the trouble is still there, there is a problem with your current crystal reports version (did you try some other version of VS/CR?)
- if the trouble is gone, you may have a typo somewhere in your replacing logic (from and to db)
HaBiX 13-Jan-12 3:32am View
Very nice find, altho i wouldnt use this solution (i'd rather move the unzipping to server side).
HaBiX 13-Jan-12 3:11am View
On first web site we're experiencing this app pool is set to .net 4.0. But as it is external hosting, we cant get to app pool settings.

On other web site (which runs on server we can access fully) app pool is set to 2.0 (default settings; running on Network Service identity)

We get the same problem on both sites.

The first app now has a timer, that echoes svc every 5 min. When it gets this exception, it writes a space at end of web.config to recompile the web. I'am ashamed of this fix :X but its the only way to keep that site alive.
HaBiX 12-Jan-12 3:19am View
We're using the client inside the using block. In some routines we're even manually calling Dispose instead of using "using" block, to get the exceptions back correctly.

I dont think the problem is in wcf client as the wcf service falls down. I can then restart IIS, but not WCF client inside windows forms and the next call to wcf will succeed.
HaBiX 15-Nov-11 6:20am View
Reason for my vote of 1
Reason: Storing FileUpload in Session -_-

another reason: Lets say i open 2 browser windows, with same session on same page.....
HaBiX 15-Nov-11 6:14am View
Reason for my vote of 4
It doesnt really end session, it just deletes the session cookie (server still holds session in memory/sql; someone with a stolen cookie can still access the session)
HaBiX 20-May-11 5:06am View
i could be wrong but i think's "with" is a compiler feature (the msil is probably same if you use "with" or not), while this version, in c#, probably produces more and slower msil (delegate, lamda, anonymous method, etc)

imho this is not good option. if i had to do it, i'd rather declare a local variable with short name pointing to the long name var..

but since i dont have to, i'll rather use #region for code segment readability and leave the code speed-optimized
HaBiX 20-Apr-11 2:47am View
**edit**guess i missclicked post comment and hit improve trick**
2) How to start Outlook,NotePad file in AsP.NET with code?
A: You dont open UI on non-UI app PERIOD

5) How Visual SourceSafe helps Us?
A: It doesnt - it locks the files on working copy when you least expect it. TFS, SVN are the answers.

I guess those are joining questions to a c# learning class, just so they know if they put you in beginner class or pre-beginner
HaBiX 7-Apr-11 3:45am View
3.70 / 5, 6 votes Vote

lot of users dont see the benefit of timespan -_-"
5 from me