public class ApiBase
{
//默认代理编号
public readonly static string AgentID = "agent88888";
private Encoding _WebEncode = ("UTF-8");
private string _RequestString;
private string _Result;
private string _RequestUrl;
private WebClient _EWebClient = new WebClient();
/// <summary>
/// 处理编码
/// </summary>
public Encoding WebEncode
{
get { return _WebEncode; }
set { _WebEncode = value; }
}
/// <summary>
/// 请求的查询参数
/// </summary>
public string RequestString
{
get { return _RequestString; }
set { _RequestString = value; }
}
/// <summary>
/// 请求返回的结果
/// </summary>
public string Result
{
get { return _Result; }
set { _Result = value; }
}
/// <summary>
/// 请求的URL地址
/// </summary>
public string RequestUrl
{
get { return _RequestUrl; }
set { _RequestUrl = value; }
}
/// <summary>
/// 客户端与服务器通信类
/// </summary>
public WebClient EWebClient
{
get { return _EWebClient; }
set { _EWebClient = value; }
}
public ApiBase(ApiType _apitype, List<QueryParam> _list)
{
= GetApiUrl(_apitype);
= GetRequestString(_list);
();
}
public ApiBase(string _ApiUrl, List<QueryParam> _list)
{
= _ApiUrl;
= GetRequestString(_list);
}
public string GetRequestString(List<QueryParam> list)
{
string requestUrl =
接入源码 来自淘豆网m.daumloan.com转载请标明出处.