由于个人需要自己编写一个上网代理服务器端软件(网上通用的CCProxy老是被网管给干掉,崩溃~!),支持http或socket的,客户端在IE里直接填写设置就可以的那种。由于小弟对这个方向的不太熟悉,请各位大虾给点实例代码或资料,感激不尽。能根据提供资料或思路尽快解决问题的,分数可以另开!  感谢!

解决方案 »

  1.   

    TcpClient tcpClient = new TcpClient(this.HostName,this.Port);
                NetworkStream ns = tcpClient.GetStream();
                StreamReader rs = new StreamReader(ns);            rs.ReadLine();            string data;
                if (context == null)
                {
                    data = command + "\r\n";
                }
                else
                {
                    data = command + " " + context + "\r\n";
                }            byte[] bytesData = Encoding.ASCII.GetBytes(data);            try
                {
                    ns.Write(bytesData, 0, bytesData.Length);
                    Debug.WriteLine(rs.ReadLine());
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                }