Èí¼þÏêϸÉè¼ÆËµÃ÷Êé(Àý) ÏÂÔØ±¾ÎÄ

ÄÚÈÝ·¢²¼¸üÐÂʱ¼ä : 2025/9/21 5:21:05ÐÇÆÚÒ» ÏÂÃæÊÇÎÄÕµÄÈ«²¿ÄÚÈÝÇëÈÏÕæÔĶÁ¡£

.

//¸Ãº¯ÊýÊǽ«×Ö·û´®×ª»»Îª×Ö½ÚÊý×é public byte[] StringtoByte(string stringInfo) {

messagebuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(stringInfo); return messagebuffer; }

//¸Ãº¯Êý½«ÕûÐÍת»»Îª¸ö×Ö½Ú public byte[] InttoByte(int number)

{

messagelength=BitConverter.GetBytes(number);

return messagelength; }

//½«¸¡µãÐÍת»»Îª¸ö×Ö½Ú

public byte[] DoubletoByte(double price) {

byte[] pricebyte = BitConverter.GetBytes(price); return pricebyte; }

//ºÏ²¢Ò»¸ö×Ö·û´®£¨×Ö½ÚÊý×飩ºÍËûµÄ³¤¶È×÷Ϊһ¸ö°ü public byte[] Combinarray(byte[] messle, byte[] messinfo) {

messagebag=new byte[messle.Length+messinfo.Length];

¾«Ñ¡·¶±¾

.

int index;

for (index = 0; index < messle.Length; index++) messagebag[index] = messagelength[index]; for (int index1 = 0; index1 < messinfo.Length; index1++) messagebag[index + index1] = messagebuffer[index1]; return messagebag;

} //½â°üÍ·

public byte[] BagHead(char head) {

byte[] headbyte = BitConverter.GetBytes(head); return headbyte; }

//¶Á°üÍ·

public char DeBagHead(byte[] buffer) {

char headinfo = BitConverter.ToChar(buffer, 0); return headinfo; }

//¸Ãº¯ÊýΪ½â°üÐÅϢΪ×Ö·û´®!

public string deMessgeBag(byte[] Messagebag,int start,out int next) {

next = BitConverter.ToInt32(Messagebag, start);

string message = System.Text.ASCIIEncoding.ASCII.GetString(Messagebag, start + 4, next);

return message; }

¾«Ñ¡·¶±¾

.

4 ÔËÐÐÉè¼Æ 4.1 ÔËÐÐÄ£¿é×éºÏ

˵Ã÷¶Ôϵͳʩ¼Ó²»Í¬µÄÍâ½çÔËÐпØÖÆÊ±ËùÒýÆðµÄ¸÷ÖÖ²»Í¬µÄÔËÐÐÄ£¿é×éºÏ£¬ËµÃ÷ÿÖÖÔËÐÐËùÀú¾­µÄÄÚ²¿Ä£¿éºÍÖ§³ÖÈí¼þ¡£

4.2 ÔËÐпØÖÆ

˵Ã÷ÿһÖÖÍâ½çµÄÔËÐпØÖƵķ½Ê½·½·¨ºÍ²Ù×÷²½Öè¡£

4.3 ÔËÐÐʱ¼ä

˵Ã÷ÿÖÖÔËÐÐÄ£¿é×éºÏ½«Õ¼Óø÷ÖÖ×ÊÔ´µÄʱ¼ä¡£

¾«Ñ¡·¶±¾

.

5 ϵͳÊý¾Ý½á¹¹Éè¼Æ 5.1 Âß¼­½á¹¹Éè¼ÆÒªµã

¸ø³ö±¾ÏµÍ³ÄÚËùʹÓõÄÿ¸öÊý¾Ý½á¹¹µÄÃû³Æ¡¢±êʶ·ûÒÔ¼°ËüÃÇÖ®ÖÐÿ¸öÊý¾ÝÏî¡¢¼Ç¼¡¢ÎľíºÍϵµÄ±êʶ¡¢¶¨Òå¡¢³¤¶È¼°ËüÃÇÖ®¼äµÄ²ã´ÎµÄ»ò±í¸ñµÄÏ໥¹ØÏµ¡£

¿Í»§¶ËÀàͼ£º

windowForm£ºForm Private£º userLogDialog

userNametextBox userPasswordtextBox userlogOKbotton

userlogCanselbutton tabPage MenuBar

stockRealtimeGraphitem stock Quote Dialog dataGridView

userBuyStockID userBuyStockcount ¾«Ñ¡·¶±¾ userBuyStockprice userBuyStockButton ...sell .

¾«Ñ¡·¶±¾

(½ÓÉÏ£© MD5encrypt£¨string£© //ÒÔ϶¼ÒªÍ¨¹ýsendMestoServer //ÏòÖ÷»ú·¢ËÍÐÅÏ¢ logOK_press(event,handle); stockQuoteitem_press(e,h); buyStockButton_press(e,h); sellStockButton_press(e,h); stocklookButton_press(e,h); ////// ¸Ãº¯Êýµ÷ÓÃdrawPicture»­Í¼ stockRealtimeGraphitem_press(e,h)