日期:2014-05-17 浏览次数:20997 次
using System;
using System.Net;
using System.IO;
using System.Text;
using System.Threading;
//http://api.map.baidu.com/geocoder?output=json&location=xxxxxx,xxxxxx&key=37492c0ee6f924cb5e934fa08c6b1676
//URLEncoder.encode
namespace ManagerServer
{
public class HttpWebRequest_BeginGetResponse
{
public class RequestState
{
// This class stores the State of the request.
const int BUFFER_SIZE = 1024;
public System.Text.Encoder CharacterSet;
public StringBuilder requestData;
public byte[] BufferRead;
public HttpWebRequest request;
public HttpWebResponse response;
public Stream streamResponse;
public RequestState()
{
BufferRead = new byte[BUFFER_SIZE];
requestData = new StringBuilder(" ");
request = null;
streamResponse = null;
}
}
public static ManualResetEvent allDone = new ManualResetEvent(false);
const int BUFFER_SIZE = 1024;
const int DefaultTimeout = 2 * 60 * 1000; // 2 minutes timeout
public delegate void ReadOverHandler(StringBuilder requestData, object exobject);
//public delegate void ReadOverHandler(StringBuilder requestData,int smstype);
public event ReadOverHandler ReadOver;
public object smstype = 0;
&nbs