Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
Questionب Pin
sima37-Feb-10 18:23
sima37-Feb-10 18:23 
AnswerIgnore Pin
Not Active7-Feb-10 18:32
mentorNot Active7-Feb-10 18:32 
GeneralRe: Ignore Pin
sima37-Feb-10 18:42
sima37-Feb-10 18:42 
Questionit appears the tab control doesn't have a click event so how can i make one ? Pin
tonyonlinux7-Feb-10 18:14
tonyonlinux7-Feb-10 18:14 
AnswerRe: it appears the tab control doesn't have a click event so how can i make one ? Pin
Not Active7-Feb-10 18:18
mentorNot Active7-Feb-10 18:18 
QuestionByte Array to uint (Hex Decimal Value) Little help [I Solved It] Pin
xEvOx7-Feb-10 17:23
xEvOx7-Feb-10 17:23 
AnswerRe: Byte Array to uint (Hex Decimal Value) Little help Pin
xEvOx7-Feb-10 17:58
xEvOx7-Feb-10 17:58 
GeneralRe: Byte Array to uint (Hex Decimal Value) Little help Pin
Luc Pattyn8-Feb-10 1:20
sitebuilderLuc Pattyn8-Feb-10 1:20 
That is some terrible code.


xEvOx wrote:
public static string HexToAscii(byte[] hex)


bad method name, nothing is hex unless it is a string holding the hex representation of something.
should be ToHexString(byte[] bytes)


xEvOx wrote:
string temp = hex[i].ToString("X");
if (temp.Length == 1)
temp = "0" + temp;


use ToString("X2") to always get at least two characters


xEvOx wrote:
string ascii = "";


in /NET all strings use Unicode, not ASCII.


xEvOx wrote:
public static uint BytetoUint(byte[] Data)


another bad method name, it does not convert a byte, in converts a byte array.
and a very inefficient way to do things: you have numbers in the byte array, turn them into a string in order to extract a numeric value. One should never do that, just work with the numbers themselves, something like (untested):

public static uint ToUint(byte[] bytes) {
    uint result=0;
    foreach(byte b in bytes) result=(result<<8) | b;
    return result;
}


Unsure | :~
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.
[The QA section does it automatically now, I hope we soon get it on regular forums as well]


QuestionClearing out controls all at one time in winform [Solved] Pin
tonyonlinux7-Feb-10 17:04
tonyonlinux7-Feb-10 17:04 
AnswerRe: Clearing out controls all at one time in winform Pin
Luc Pattyn7-Feb-10 17:09
sitebuilderLuc Pattyn7-Feb-10 17:09 
AnswerRe: Clearing out controls all at one time in winform Pin
Not Active7-Feb-10 17:11
mentorNot Active7-Feb-10 17:11 
GeneralRe: Clearing out controls all at one time in winform Pin
tonyonlinux7-Feb-10 17:58
tonyonlinux7-Feb-10 17:58 
QuestionVB6 to c#. Pin
A.Machan Kachan7-Feb-10 15:29
A.Machan Kachan7-Feb-10 15:29 
AnswerRe: VB6 to c#. Pin
Not Active7-Feb-10 16:56
mentorNot Active7-Feb-10 16:56 
AnswerRe: VB6 to c#. Pin
Mycroft Holmes7-Feb-10 19:08
professionalMycroft Holmes7-Feb-10 19:08 
Question64-bit Registry from 64-bit Application Pin
Steve Harp7-Feb-10 12:09
Steve Harp7-Feb-10 12:09 
Questionform resizing Pin
Karrottop7-Feb-10 9:49
Karrottop7-Feb-10 9:49 
AnswerRe: form resizing Pin
Hesham Amin7-Feb-10 10:01
Hesham Amin7-Feb-10 10:01 
GeneralRe: form resizing Pin
Karrottop7-Feb-10 10:47
Karrottop7-Feb-10 10:47 
GeneralRe: form resizing Pin
DaveyM697-Feb-10 11:34
professionalDaveyM697-Feb-10 11:34 
GeneralRe: form resizing Pin
Mycroft Holmes7-Feb-10 19:11
professionalMycroft Holmes7-Feb-10 19:11 
GeneralRe: form resizing Pin
Hesham Amin7-Feb-10 20:25
Hesham Amin7-Feb-10 20:25 
QuestionC# Pin
r.kh7-Feb-10 9:22
r.kh7-Feb-10 9:22 
AnswerRe: C# Pin
Alex Manolescu7-Feb-10 10:46
Alex Manolescu7-Feb-10 10:46 
GeneralRe: C# Pin
harold aptroot7-Feb-10 11:37
harold aptroot7-Feb-10 11:37 

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.