全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:3343
推到 Plurk!
推到 Facebook!

請問一下怎麼寫簡單的bbs程式

答題得分者是:turboted
GGL
資深會員


發表:104
回覆:600
積分:335
註冊:2006-11-05

發送簡訊給我
#1 引用回覆 回覆 發表時間:2002-08-30 17:18:39 IP:218.184.xxx.xxx 未訂閱
請問一下怎麼寫簡單的bbs程式?我現在只能連線到bbs但是不知道如何將畫面顯示出來,請知道的人告知一下吧...謝謝
turboted
版主


發表:95
回覆:754
積分:452
註冊:2002-07-23

發送簡訊給我
#2 引用回覆 回覆 發表時間:2002-08-30 17:57:55 IP:210.71.xxx.xxx 未訂閱
連線是屬於WinSock 的部份 連上線show 畫面是ANSI 碼的處理部份 (1)重點在於你連上線到是否能接收SERVER 送過來的DATA (2)接到DATA 後就能做處理(ANSI)
GGL
資深會員


發表:104
回覆:600
積分:335
註冊:2006-11-05

發送簡訊給我
#3 引用回覆 回覆 發表時間:2002-08-30 18:21:41 IP:218.184.xxx.xxx 未訂閱
謝謝turboted... 我確定能接收server傳來的資料,因為我可以將訊息show在memo上,只是會怪怪的,而且也無法輸入帳號or密碼登入bbs裡。 最重要的一點是我不知道如何處理ANSI..煩請指教囉!!謝謝
turboted
版主


發表:95
回覆:754
積分:452
註冊:2002-07-23

發送簡訊給我
#4 引用回覆 回覆 發表時間:2002-08-30 22:25:26 IP:61.216.xxx.xxx 未訂閱
我想,你可以去BBS的ANSI討論區裏面看看 最多終端機模擬器支援的低階界面: vt100 系列控制碼  有時也稱 ANSI Escape Sequence    然而VT100 的SPEC 如下,希望足夠解決您的問題了 記得Close 的分數要給我喔.c.c.    Taken from VT100 Programming Reference Card (DIGITAL)    ANSI Compatible Mode            Cursor Movement Commands                 Cursor up                       ESC [ Pn A                 Cursor down                     ESC [ Pn B                 Cursor forward (right)          ESC [ Pn C                 Cursor backward (left)          ESC [ Pn D                 Direct cursor addressing        ESC [ Pl; Pc H  or                                                 ESC [ Pl; Pc f                 Index                           ESC D                 Next Line                       ESC E                 Reverse index                   ESC M                 Save cursor and attributes      ESC 7                 Restore cursor and attributes   ESC 8                 * Pn = decimal parameter in string of ASCII digits.(default 1)                 * Pl = line number (default 0); Pc = column number (default 0)            Line Size (Double-Height and Double-Width) Commands                 Change this line to double-height top half      ESC # 3                 Change this line to double-height bottom half   ESC # 4                 Change this line to single-width single-height  ESC # 5                 Change this line to double-width single-height  ESC # 6            Character Attributes                 ESC [ Ps;Ps;Ps;...,Ps m                 Ps =    0 or None       All Attributes Off                         1               Bold on                         4               Underscore on                         5               Blink on                         7               Reverse video on                 Any other parameter values are ignored.            Erasing                 From cursor to end of line              ESC [ K  or ESC [ 0 K                 From beginning of line to cursor        ESC [ 1 K                 Entire line containing cursor           ESC [ 2 K                 From cursor to end of screen            ESC [ J  or ESC [ 0 J                 From beginning of screen to cursor      ESC [ 1 J                 Entire screen                           ESC [ 2 J            Programmable LEDs                 ESC [ Ps;Ps;...Ps q                 Ps =    0 or None       All LEDs Off                         1               L1 on                         2               L2 on                         3               L3 on                         4               L4 on                 Any other parameter values are ignored.            Character Set (G0 and G1 Designators)                 Charactor Set                   G0 Designator   G1 Designator                 United Kingdom (UK)             ESC ( A         ESC ) A                 United States (USASCII)         ESC ( B         ESC ) B                 Special graphics characters     ESC ( 0         ESC ) 0                  and line drawing set                 Alternate character ROM         ESC ( 1         ESC ) 1                 Alternate character ROM         ESC ( 2         ESC ) 2                  special graphics characters            Scrolling Region                 ESC [ Pt ; Pb r                 Pt is the number of the top line of the scrolling region;                 Pb is the number of the bottom line of the scrolling region                 and must be greater than  Pt.                 (The default for Pt is line 1, the default for Pb is the end                  of the screen)            TAB stops                 Set tab at current column               ESC H                 Clear tab at curent column              ESC [ g or ESC [ 0 g                 Clear all tabs                          ESC [ 3 g            Modes                                   To Set                To Reset         Mode Name            Mode        Sequence   Mode        Sequence         Line feed/new line   New line    ESC [20h   Line feed   ESC [20l         Cursor key mode      Application ESC [?1h   Cursor      ESC [?l         ANSI/VT52 mode       ANSI        N/A        VT52        ESC [?2l         Column mode          132 Col     ESC [?3h   80 Col      ESC [?3l         Scrolling mode       Smooth      ESC [?4h   Jump        ESC [?4l         Screen mode          Reverse     ESC [?5h   Normal      ESC [?5l         Origin mode          Relative    ESC [?6h   Absolute    ESC [?6l         Wraparound           On          ESC [?7h   Off         ESC [?7l         Auto repeat          On          ESC [?8h   Off         ESC [?8l         Interlace            On          ESC [?9h   Off         ESC [?9l         Graphic proc. option On          ESC 1      Off         ESC 2         Keypad mode          Application ESC =      Numeric     ESC >            Reports                 Cursor Position Report                 Invoked by                      ESC [ 6 n                 Response is                     ESC [ Pl; Pc R                 * Pl = line number; Pc = column number            Status Report                 Invoked by                      ESC [ 5 n                 Response is                     ESC [ 0 n  (terminal ok)                                                 ESC [ 3 n  (terminal not ok)            What Are You                 Invoked by                      ESC [ c  or  ESC [ O c                 Response is                     ESC [ ?1 ; Ps C                 Ps =    0       Base VT100, no options                         1       Processor option (STP)                         2       Advanced Video option (AVO)                         3       AVO and STP                         4       Graphocs processor option (GO)                         5       GO and STP                         6       GO and AVO                         7       GO, STP, and AVO         Alternately invoked by ESC Z (not recommended.) Response is the same.            Reset                 ESC c            Confidence Tests         Fill Screen with "Es"           ESC # 8         Invoke Test(s)                  ESC [ 2 ; Ps y         Ps =    1                               Power-up self test                                                 (ROM checksum, RAM, NVR,                                                 keyboard and AVO if installed)                 2(loop back connector required) Data Loop Back                 4(loop back connector required) ETA Modern Control Test                 8                               Repeat selected test(s)                                                 indefinitely                                                 (until failure or power off)    VT52 Compatible Mode         Cursor Up                               ESC A         Cursor Down                             ESC B         Cursor Right                            ESC C         Cursor Left                             ESC D         Select Special Graphics character set   ESC F         Select ASCII character set              ESC G         Cursor to home                          ESC H         Reverse line feed                       ESC I         Erase to end of screen                  ESC J         Erase to end of line                    ESC K         Direct cursor address                   ESC Ylc         (see note 1)         Identify                                ESC Z           (see note 2)         Enter alternate keypad mode             ESC =         Exit alternate keypad mode              ESC >         Enter ANSI mode                         ESC <            NOTE 1: Line and column numbers for direct cursor address are single                 character codes whose values are the desired number plus                 37 (in Octal). Line and column numbers start at 1.         NOTE 2: Response to ESC Z is ESC / Z.        -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Simon Chan                                      chan@ece.scarolina.edu Department of Electrical & Computer Engineering Swearingen Engineering Centre University of South Carolina Coulmbia, South Carolina 29208 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-    Article 269 of comp.terminals: Path: cs.utk.edu!gatech!news.ans.net!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.terminals Subject: Re: VT100 Reference Card !! Keywords: vt100 terminal escape codes Message-ID: <19629@smoke.brl.mil> Date: 1 Feb 93 15:01:49 GMT References: Organization: U.S. Army Ballistic Research Lab, APG MD. Lines: 25 In article chan@ece.scarolina.edu (Simon Chan) writes: >Taken from VT100 Programming Reference Card (DIGITAL) Note that EK-VT100-RC-001 contains several errors and omissions. The errors appear to all be fixed in the posted version. Here are some additions: Parameters to Direct cursor addressing can be omitted if 1. "Index" is broken if NEWLINE is enabled (set-up). "Reverse index" scrolls up retaining the same column. CHARACTER SET DESIGNATORS: G0 = Shift-In, G1 = Shift-Out > ANSI/VT52 mode ANSI N/A VT52 ESC [?2l ANSI/VT52 mode ANSI ESC < VT52 ESC [?2l Modes can be combined using ";", for example "ESC [ ? 3 ; 4 ; 7 h" CONFIDENCE TESTS: Parameter bits are summed into one parameter. Hardcopy ESC # 7 Graphic processor ON ESC 1 Graphic processor OFF ESC 2 The reference card showed incorrect graphics for octal code 140; its correct graphic is ` (accent grave).
GGL
資深會員


發表:104
回覆:600
積分:335
註冊:2006-11-05

發送簡訊給我
#5 引用回覆 回覆 發表時間:2002-08-31 12:16:35 IP:218.184.xxx.xxx 未訂閱
to turboted 老實說,我看不懂ㄝ...基本上我認為我寫程式的能力蠻濫的... 我現在能連進BBS也能輸入文字,只是顯示出來的結果很亂,根本看不懂,還有就是原本按鍵盤的方向鍵可以在BBS裡移動,現在卻只是在Memo上游標的移動.. 是不是要經過解碼才能將顯示出來的結果正常化,我目前不求文字的顏色或其他的功能,我只希望能顯示出正常的訊息讓我正確的瀏覽BBS就好了...謝謝
turboted
版主


發表:95
回覆:754
積分:452
註冊:2002-07-23

發送簡訊給我
#6 引用回覆 回覆 發表時間:2002-08-31 14:57:23 IP:61.216.xxx.xxx 未訂閱
如果你不需要ANSI 色彩的話 你就把傳送過來的字串中 有關色彩的字串給濾掉就好了 大多數的ANSI字串用法就如同我上面POST的 內容包含 *[ 31m,,,,例如這些 後面就會接一般字串,當然雙色字就例外了..
系統時間:2024-04-25 13:15:56
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!