Click here to Skip to main content
15,922,584 members
Home / Discussions / C#
   

C#

 
AnswerRe: converting image to bitmap Pin
Judah Gabriel Himango13-Nov-07 4:04
sponsorJudah Gabriel Himango13-Nov-07 4:04 
JokeRe: converting image to bitmap Pin
Not Active13-Nov-07 5:08
mentorNot Active13-Nov-07 5:08 
GeneralRe: converting image to bitmap Pin
Vasudevan Deepak Kumar13-Nov-07 20:28
Vasudevan Deepak Kumar13-Nov-07 20:28 
QuestionDisabling default context Menu Pin
Adnan Siddiqi13-Nov-07 3:19
Adnan Siddiqi13-Nov-07 3:19 
AnswerRe: Disabling default context Menu Pin
Judah Gabriel Himango13-Nov-07 4:04
sponsorJudah Gabriel Himango13-Nov-07 4:04 
GeneralRe: Disabling default context Menu Pin
Adnan Siddiqi13-Nov-07 5:53
Adnan Siddiqi13-Nov-07 5:53 
QuestionHow to convert to C# code Pin
Programm3r13-Nov-07 3:15
Programm3r13-Nov-07 3:15 
AnswerRe: How to convert to C# code Pin
Anthony Mushrow13-Nov-07 3:54
professionalAnthony Mushrow13-Nov-07 3:54 
I think this would be it:

ushort crc16(ref char pBuf, short Len, short InitialCrc)
{
	int crc=0, i=0;
	crc = 0;
	
	for (i = 0; i < Len; i++ )	{
		crc = (crc >> 8) | (crc << 8);
		crc = crc ^ pBuf;
		crc = crc ^ ((crc & 0xff) >> 4);
		crc = crc ^ (crc << 12);
		crc = crc ^ ((crc & 0xff) << 5);
		pBuf++;    
	}    
	return((ushort)crc);
}


Everything stays the same, short unsigned int, becomes ushort. short int becoms short.
I changed crc to an int because whenever you did a bitwise operation, it came back as one, so you just change it back when you return it.



My current favourite word is: PIE!

Good ol' pie, it's been a while.

AnswerRe: How to convert to C# code Pin
Judah Gabriel Himango13-Nov-07 3:59
sponsorJudah Gabriel Himango13-Nov-07 3:59 
QuestionRe: How to convert to C# code Pin
Programm3r13-Nov-07 20:08
Programm3r13-Nov-07 20:08 
AnswerRe: How to convert to C# code Pin
Guffa13-Nov-07 5:59
Guffa13-Nov-07 5:59 
GeneralRe: How to convert to C# code Pin
Programm3r13-Nov-07 18:29
Programm3r13-Nov-07 18:29 
QuestionDatetime Problem Pin
Navneet Hegde13-Nov-07 3:10
Navneet Hegde13-Nov-07 3:10 
AnswerRe: Datetime Problem Pin
Laoujin13-Nov-07 4:03
Laoujin13-Nov-07 4:03 
QuestionFinding currently logged on user Pin
conor2013-Nov-07 2:52
conor2013-Nov-07 2:52 
AnswerRe: Finding currently logged on user Pin
Justin Perez13-Nov-07 3:09
Justin Perez13-Nov-07 3:09 
AnswerRe: Finding currently logged on user Pin
Vasudevan Deepak Kumar13-Nov-07 20:32
Vasudevan Deepak Kumar13-Nov-07 20:32 
GeneralRe: Finding currently logged on user Pin
conor2015-Nov-07 4:55
conor2015-Nov-07 4:55 
GeneralRe: Finding currently logged on user Pin
conor2016-Nov-07 0:32
conor2016-Nov-07 0:32 
QuestionExport File Pin
MumbleB13-Nov-07 2:44
MumbleB13-Nov-07 2:44 
AnswerRe: Export File Pin
duncanmhor13-Nov-07 2:56
duncanmhor13-Nov-07 2:56 
AnswerRe: Export File Pin
SVb.net13-Nov-07 5:51
SVb.net13-Nov-07 5:51 
QuestionHow to control forecolor of a disabled label Pin
baelzaden13-Nov-07 1:39
baelzaden13-Nov-07 1:39 
Questionfile rename application Pin
Sunil Wise13-Nov-07 1:18
professionalSunil Wise13-Nov-07 1:18 
Questionadd column to datagridview Pin
arkiboys13-Nov-07 1:15
arkiboys13-Nov-07 1:15 

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.