BBS program design 3 - Common functions (below)

xiaoxiao2021-03-06  42

Sender: loveYou (Dreamman), letter area: DAS_ROOM Title: BBS program design 3 - Common functions (below) Sending station: Jincheng Station (WED APR 26 14:26:07 2000), transfer

BBS own is a lot of functions. It can't be said. Commonly used it is also finished. About this, you can find it yourself, look at how people write, how to use it. I only remember a little bit. Most of them are used in the program to check it. ============================================================================================================================================================================= ==========================================================================================================================================================

SecurityReport ()

This is a function of system recording. If you delete an account, you will automatically generate this record in the System Security Record Discussion area, which is called. This function is called. Example: When you determine that after deleting the discussion area, you have to write char SECU [Strlen];

Sprintf (SECU, "Delete Discussion Area:", binfo.filename);

SecurityReport (SECU);

If you delete the discussion area Test, you will see the article in the Security discussion area, the topic is "Delete the Discussion Forum: Text", the content is your various information. ============================================================================================================================================================================================================= ==================

SHOW_HELP (Help file name) show_help (Help file name) BBS system HELP file generally put it in the Help directory of BBSHome. You can go see. That is, a general / home / bbs / help directory. Such as I want to be in the user When chatting, press CTRL H to view help: First I edit a file in the Help directory: OnChathelp write help information in the DO_TALK_CHAR () function in the chat program talk.c file (you can find A slit: Case Ctrl ('h'): show_help ("Help / OnChathelp"); return; this is ok. When the user presses Ctrl h while the user presses Ctrl h, you will display your onchathelp file content. The default current directory in the .BBS program is the root directory of BBSHome, so you don't write / home / bbs / help / onchathelp to write help / onchathelp ============== ============================================================================================================================================================================================================= ===== m_send (User ID) Send a user. ================================================================== ===================================================== DO_SENDMSG () This is a function of sending information, and its parameters are a bit complicated. Not very clear, don't use it. I probably say: I want to send a message on the station. I have to get its user_info structure. (Self-learning) If you get someone User_info structure, you can save it in user_record, then you can This way: do_sendmsg (user_record, null, 0, user_record.pid); do_sendmsg (user_record, null, 0, user_record.pid); ~~~~~~~~~~~~~~ This is saved in user_infoThe user process in the structure. ===============================

=============================================== getData () This is a very useful function, Its parameters are also a lot, but it is not difficult. Remember it. It gets the user's input in a certain position. GetData (0, 0, "Please enter your password:", Passbuf, 15, noecho, null, yea); 0, 0 means "Please enter the password:" Wait for the user to enter. Noecho means that the user is displayed in the '*' number. NULL means that the user does not enter, and directly The default value of the car. Passbuf is used to save the content entered by the user, you can use it to determine what the user is entered. ================== ============================================================================================================================================================================================================= = PressanyKey () This function does not have a parameter. Refers to the user to continue. If you receive the information received in the BBS query, the lower display when you turn to the last screen is: Press anymore to continue ... this is The result of the PressanyKey () function. ========================================= ====================================================== Example: When the user starts chatting Write MODIFY_USER_MODE (Talk); Example: Write MODIFY_USER_MODE (Talk) when the user starts chatting; this "talk" is defined in the modes.h file of the include directory. You can view it yourself. ====== =====================================

===========================4 =========================================================================================================================================================================================================== : The location of the user's Home is in the first letter of the Home / User ID in the bbShome directory / user code / this directory, and save each user's instruction file, registration information, unsaved information, etc. *) Example: If you want to display the information received by the user, the information received; setuserfile (FNAME, "MSGFile"); clear (); modify_user_mode (lookmsgs); if (Dashf (FNAME)) {ANSIMORE (FNAME, YEA); CLEAR ()} Else {move (5, 30); Prints ("No Information Existence"); PressanyKey ();} This program is very classics, the BBS commonly used functions are much. Move (5, 30); ANSIMORE () Is showing a file content, which is saved here is the full path name of the information file. Msgfile is the file in the user's home directory, saved is the information received by the user. Dashf (fname) is a path to the FNAME saved Whether the file exists, if there is returning 1. ======================================== ===================================================================================================================================================== I can only think of this now, there are a lot, I will explain it again in the future.

- ※ Source: · Meilong Inn BBS.ECust.edu.cn · [from: 211.144.72.160]

转载请注明原文地址:https://www.9cbs.com/read-54646.html

New Post(0)