Click here to Skip to main content
15,913,944 members
Home / Discussions / C#
   

C#

 
QuestionHow can I flush events for a form? Pin
JoeRip27-Dec-07 17:50
JoeRip27-Dec-07 17:50 
AnswerRe: How can I flush events for a form? Pin
KaptinKrunch28-Dec-07 3:39
KaptinKrunch28-Dec-07 3:39 
GeneralRe: How can I flush events for a form? Pin
JoeRip28-Dec-07 9:57
JoeRip28-Dec-07 9:57 
QuestionHow to access cookie values in a single domain? Pin
Reena.E27-Dec-07 17:30
Reena.E27-Dec-07 17:30 
AnswerRe: How to access cookie values in a single domain? Pin
Paul Conrad28-Dec-07 10:20
professionalPaul Conrad28-Dec-07 10:20 
GeneralByte to hex string conversion Pin
piyush123027-Dec-07 17:27
piyush123027-Dec-07 17:27 
GeneralRe: Byte to hex string conversion Pin
Scott Dorman27-Dec-07 18:15
professionalScott Dorman27-Dec-07 18:15 
GeneralRe: Byte to hex string conversion Pin
Colin Angus Mackay28-Dec-07 0:12
Colin Angus Mackay28-Dec-07 0:12 
Some ideas that might make your code work more efficiently.

piyush1230 wrote:
str = sr.ReadToEnd();


So, you need to reserve a large block of memory to read the file. It is more efficient to read smaller chunks of the file, say a kilobyte or two, at a time.


piyush1230 wrote:
m_abyData[i] = (byte)str[i];


You convert the string you have read form the file into a string, then convert it (badly) to binary again. Why not just read the file as a binary file in the first place? Then you won't have a double conversion. (i.e. .NET reads the file as binary then converts it to a string because that is what you asked for, then you convert it back to binary)

piyush1230 wrote:
sbVar.Append(string.Format("{0:X2}", m_abyData[i]));


sbVar is not declared anywhere in the code you've provided so I'm guessing that it is a StringBuilder object. Do you need to build this in memory? Can it be written to a file as you go?


GeneralRe: Byte to hex string conversion Pin
piyush123028-Dec-07 3:37
piyush123028-Dec-07 3:37 
GeneralRe: Byte to hex string conversion Pin
Luc Pattyn28-Dec-07 4:25
sitebuilderLuc Pattyn28-Dec-07 4:25 
General[Message Deleted] Pin
Aparna.B27-Dec-07 17:11
Aparna.B27-Dec-07 17:11 
GeneralRe: FTP Pin
KaptinKrunch28-Dec-07 3:41
KaptinKrunch28-Dec-07 3:41 
GeneralDateTime Format Pin
eggie527-Dec-07 16:42
eggie527-Dec-07 16:42 
GeneralRe: DateTime Format Pin
JoeRip27-Dec-07 17:55
JoeRip27-Dec-07 17:55 
GeneralRe: DateTime Format [modified] Pin
JoeRip27-Dec-07 18:00
JoeRip27-Dec-07 18:00 
GeneralRe: DateTime Format Pin
Xmen Real 27-Dec-07 22:19
professional Xmen Real 27-Dec-07 22:19 
GeneralRe: DateTime Format Pin
PIEBALDconsult28-Dec-07 13:38
mvePIEBALDconsult28-Dec-07 13:38 
GeneralRe: DateTime Format Pin
eggie528-Dec-07 13:44
eggie528-Dec-07 13:44 
Questionhow to get motherboard and hard-disk serial number ? Pin
E_Gold27-Dec-07 11:03
E_Gold27-Dec-07 11:03 
AnswerRe: how to get motherboard and hard-disk serial number ? Pin
Kristian Sixhøj27-Dec-07 11:14
Kristian Sixhøj27-Dec-07 11:14 
AnswerRe: how to get motherboard and hard-disk serial number ? Pin
Paul Conrad27-Dec-07 15:01
professionalPaul Conrad27-Dec-07 15:01 
AnswerRe: how to get motherboard and hard-disk serial number ? Pin
Abhijit Jana27-Dec-07 21:42
professionalAbhijit Jana27-Dec-07 21:42 
QuestionHow to change the input language programmatically ? Pin
Aldorado27-Dec-07 10:41
Aldorado27-Dec-07 10:41 
AnswerRe: How to change the input language programmatically ? Pin
Aldorado27-Dec-07 11:22
Aldorado27-Dec-07 11:22 
GeneralRe: How to change the input language programmatically ? Pin
Paul Conrad27-Dec-07 15:01
professionalPaul Conrad27-Dec-07 15:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.