📄 00000003.htm
字号:
<HTML><HEAD> <TITLE>BBS水木清华站∶精华区</TITLE></HEAD><BODY><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER>发信人: lenx (冷·枫), 信区: Linux <BR>标 题: simple finger/pop3 TCL/TK client <BR>发信站: BBS 水木清华站 (Sun Sep 7 13:55:20 1997) <BR> <BR>一个tcl/tk的小例子 <BR> <BR> 作者 <A HREF="mailto:Mephis.bbs@bbs.ee.ncu.edu.tw">Mephis.bbs@bbs.ee.ncu.edu.tw</A> (梅菲斯特), 看板 Linux <BR> 标题 simple finger/pop3 TCL/TK client <BR> 时间 中央大学松涛风情资讯站 (Sun Jan 19 09:18:27 1997) <BR>——————————————————————————————————————— <BR> <BR>花一个早上用 TCL/TK 写的, 希望对网友有帮助 :) <BR>BTW, 若堪使用, 烦请用 e-mail 告知你的 plateform tks <BR> <BR>#!/bin/sh <BR># the next line restarts using wish \ <BR>exec wish4.2 "$0" "$@" <BR> <BR>proc fingerWrit {} { <BR> global finger_sock <BR> <BR> fileevent $finger_sock writable {} <BR> flush $finger_sock <BR>} <BR> <BR>proc fingerSend {message} { <BR> global finger_sock <BR> <BR> fileevent $finger_sock writable fingerWrit <BR> puts $finger_sock $message <BR>} <BR> <BR>proc fingerRead {} { <BR> global finger_sock <BR> <BR> if { [gets $finger_sock finger_buff] < 0 } { <BR> close $finger_sock <BR> return <BR> } <BR> puts $finger_buff <BR>} <BR> <BR>proc fingerOpen {} { <BR> global hostname portname username <BR> global finger_sock <BR> if {[catch {socket $hostname $portname} finger_sock]!=0} { <BR> tk_dialog .errorMsg "ERROR MESSAGE" $finger_sock question 0 OK <BR> return <BR> } <BR> # fconfigure $sd -blocking false <BR> # puts "After socket command" <BR> <BR> fileevent $finger_sock readable fingerRead <BR> fingerSend $username <BR>} <BR> <BR>proc pop3Error {} { <BR> global pop3_sock pop3_buff <BR> <BR> tk_dialog .errorMsg "ERROR MESSAGE" $pop3_buff info 0 OK <BR> fileevent $pop3_sock readable {} <BR> close $pop3_sock <BR>} <BR> <BR>proc pop3Writ {} { <BR> global pop3_sock <BR> <BR> fileevent $pop3_sock writable {} <BR> flush $pop3_sock <BR>} <BR> <BR>proc pop3Send {message} { <BR> global pop3_sock <BR> <BR> fileevent $pop3_sock writable pop3Writ <BR> puts $pop3_sock $message <BR>} <BR> <BR>proc pop3Read {} { <BR> global username password <BR> global pop3_sock pop3_stat pop3_list pop3_line pop3_buff <BR> global pop3_mail pop3_retr <BR> if { [gets $pop3_sock pop3_buff] < 0 } { <BR> # puts "REACH EOF" <BR> close $pop3_sock <BR> return <BR> } <BR> if [string compare $pop3_stat retr_context] { <BR> puts $pop3_buff <BR> } else { <BR> incr pop3_line <BR> puts [format "%d:%s$" $pop3_line $pop3_buff] <BR> } <BR> <BR> <BR> switch $pop3_stat { <BR> send_user { <BR> if [string compare [lindex $pop3_buff 0] "+OK"] { <BR> pop3Error <BR> return <BR> } <BR> pop3Send "USER $username" <BR> set pop3_stat send_pass <BR> } <BR> send_pass { <BR> if [string compare [lindex $pop3_buff 0] "+OK"] { <BR> pop3Error <BR> return <BR> } <BR> pop3Send "PASS $password" <BR> set pop3_stat login_ok <BR> } <BR> login_ok { <BR> if [string compare [lindex $pop3_buff 0] "+OK"] { <BR> pop3Error <BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -