submit.htm
来自「网络聊天,写的比较简单,但比较容易看懂,别的就不用说了吧」· HTM 代码 · 共 56 行
HTM
56 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--#include virtual="header.shtml" --><!--#include virtual="/global/getCss.inc" --><HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY>
<CENTER><H3><FONT COLOR="#a0a099">
[Chat Program using Asynchronous Socket]
</FONT></H3></CENTER><HR>
<!-- Author and contact details -->
This article was contributed by
<A href="mailto:mokth@hotmail.com">[TH Mok]</A>. <!-- Sample image - gif or jpg -->
<P><IMG src="[image filename here]" > <!-- For which environment is this code specific??? -->
<p><u>Environment:</u> [ C#]
<p><!-- The 'p' starts a paragraph of normal text --><FONT
face=Arial size=2>
This
is a simple chat program using asynchronous socket. This program is
act like client/server, it can</FONT><FONT face=Arial size=2>connect to other PC (install with
same program) or wait for other PC to connect. You can test the
program on the same PC by running the program twice. Each one listen
to an port (e.g. first is listen to 998 and the second to
999). Click the listen button of both program, key in the
hostname/Host IP Address as "local" or "127.0.0.1" and Port no as 999
at first program (cause we want to connect to the second program which
listen to port 999), click connect. The IP address will list at the
list of the 2 program (if successfully connected). At this point, u
can start sending messages. </FONT>
<DIV><FONT face=Arial size=2> In the simple program also, i also
demonstrated how the event is raised during connection, disconnection, sending
and receiving (like the OnConnect, OnSend... in MSVC++ MFC's socket
class).</FONT></DIV>
<DIV><FONT face=Arial size=2> Any suggestion, amendment or comment
is welcome, cause i still new in C#. </FONT> <!-- create more blocks of article text as needed separated --><!-- with the <p> HTML tag --><!-- start a block of source code --></DIV>
<PRE>
</PRE>
<h3>Downloads</h3><!-- demo and source files -->
<A href="ChatSocket.zip">
Download demo project - 13 Kb</A><BR>
<A href="Socketexe.zip">
Download source - 10 Kb</A>
<h3>History</h3>
Date Posted: March 20, 2002 <BR><!-- Only use the following if the article is updated --><!-- Date Last Updated: [today's date in the format month day, year] --><!--#include virtual="footer.shtml" --></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?