Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

请如如何让TcpClient通过代理来访问?

10 views
Skip to first unread message

ares

unread,
Sep 17, 2009, 3:12:27 AM9/17/09
to
�ҵ�Ҫ��ܼ�,ֻ������ TcpClientͨ�������ȡ��һ����ҳ(��http://www.126.com)������

�����д�����Ĵ���,����޸���δ���,�������ͨ����������������URL��?

///<summary>
///���������������
///</summary>
///<param name="URL">�����ַ</param>
///<param name="method">POST��GET</param>
///<param name="showProgress">�Ƿ���ʾ�ϴ����</param>
private void SendRequestData(string URL, string method, bool
showProgress)
{
clientSocket = new TcpClient();
Uri URI = new Uri(URL);
clientSocket.Connect(URI.Host, URI.Port);

requestHeaders.Add("Host", URI.Host);
byte[] request = GetRequestHeaders(method + " " +
URI.PathAndQuery + " HTTP/1.1");
clientSocket.Client.Send(request);
//......
}


��Ϊ����ͻ������ھ������ڲ�ʹ��.���������TcpClientͨ�����������?


0 new messages