摘要:
namespace mysmtp
{
using system;
using system.net;
using system.net.sockets;
using system.text;
using system.collections;
interface itransport
{
void sethost(string smtphost);
string g......
摘要:
下面举个简单的例子来说明怎么使用这个基类。下面这个server实现的功能很简单,通过实现基类的docommunication抽象方法来实现监听8000端口,如果有客户端连接,就发送一条信息。为了说明stop的用法,我另起了一个线程在30秒后自动关闭这个server.你可以把程序编译后运行,然后通过ie来访问看一下实现的功能。
testserver.cs
using syste......
为了表示歉意,再贴一个Socket编的!让CNet加真酷!
//调用示例
private void button1_click(object sender, system.eventargs e)
{
(new windowsapplication1.httprequestresponse()).sendrequestandgetresponse();
(new windowsapplication1.httprequestresponse()).sendrequestandgetresponse();
(new windowsapplication1.httprequestresponse()).sendrequestandgetresponse();
(new windowsapplication1.httprequestresponse()).sendrequestandgetresponse();
(new windowsapplication1.httprequestresponse()).sendrequestandgetresponse();
(new windowsapplication1.httprequestresponse()).sendrequestandgetresponse();
system.windows.forms.messagebox.show ("send end") ;
}
//很久(去年)以前写的 socket 级的 class1.cs
using system;
/// <summary>
/// class1 的摘要说明....
下一页 摘要:
http.cs
----------------------------
using system;
using system.collections;
using system.io;
using system.net;
using system.net.sockets;
using system.threading;
class httpprocessor {......