This article is original. If you need to reprint it, please indicate the author and the source. Thank you!
Obtained in this articleThird prize of the second Microsoft. NET platform application development Essay Competition
I. Preface Windows Presentation Foundation (WPF) is a set of interface implementation technologies recently launched by Microsoft. This technology implements the interface design and logic Code . In WPF technology, the interface design is completed by the XAML file. The XAML file is in XML format and is used to set properties and events of various controls (such as text boxes, lists, and buttons) on the user interface. Currently, the logic code in WPF can be written in C # Or VB. NET. Compiling Method and traditional. net Program Similar. In this article, WPF is used as the interface implementation technology to complete the wuziqi program. On the surface, the five-game program implemented in this article is just a common online game, but in fact, this online game does not need to write the server program by yourself, you do not need to prepare a 24-hour boot server for playing games. The internal communication protocol of this game uses the MSN protocol. Therefore, you can directly use the MSN account (an e-mail address) to log on and expand the token between friends. The wuziqi game provided in this article uses an open-source MSN protocol implementation (dotmsn2.0) for communication between MSN users. Dotmsn2.0 can be downloaded from the following URL: http://www.xihsolutions.net/dotmsn/download.html if you want to learn more about the MSN protocol, you can visit the following URL: in this game program, the http://www.hypothetic.org/docs/msn/index.php uses the LINQ technology to read the MSN account saved in the XML file, and write the user's last successful login MSN account into the XML file. For the sake of security, this program does not save the password in the XML file. Therefore, every time you log on to the game, you must enter the password of the MSN account. II. Implementation Principle With dotmsn2.0, you can easily use an MSN account to log on and chat with friends. However, the program provided in this article uses some special information (with a special prefix before the information) to send the chess command (the position where the player moves the chess piece) and the control command. If both parties use the five-game program, the chess and control commands will not appear in the chat records. The system interprets these commands as corresponding actions. For example, when a player takes a step, the system will send the position of the player's pawns to another player, another player's play chess program will explain the command as the position of the chess piece, and place the chess piece under the opponent in the corresponding position of the Board. The same method will be used when the player moves.
Original: http://www.comprg.com.cn/ I .net/product_show.asp? Id = 356