获取远程xml数据-表结构

<span style="white-space:pre">	</span>/// <summary>
        /// 获取远程接口数据-表结构
        /// </summary>
        /// <param name="target">目标接口</param>
        /// <param name="ResponseTimeoutSeconds">响应超时时间(单位秒)</param>
        /// <param name="ReadWriteTimeoutSeconds">读写流超时时间(单位秒)</param>
        /// <returns>数据表结果集</returns>
        public static DataSet DownLoadRemoteData(string target,int ResponseTimeoutSeconds,int ReadWriteTimeoutSeconds)
        {
            DataSet ds = new DataSet();
            try
            {
                HttpWebRequest Request = System.Net.WebRequest.Create(target) as HttpWebRequest;
                Request.Method = "Get";
                //设置超时时间
                Request.Timeout = ResponseTimeoutSeconds * 1000;
                Request.ReadWriteTimeout = ReadWriteTimeoutSeconds * 10000;
                using (StreamReader responseReader = new StreamReader(Request.GetResponse().GetResponseStream(),Encoding.GetEncoding("gb2312")))
                {
                    XmlTextReader xmlReader = new XmlTextReader(responseReader);
                    ds.ReadXml(xmlReader);
                }
            }
            catch
            {
                ds = null;
            }
            return ds;
        }

相关文章

引言 NOKIA 有句著名的广告语:“科技以人为本”。任何技术都是为了满足人的生产生活需要而产生的。具体...
Writer:BYSocket(泥沙砖瓦浆木匠) 微博:BYSocket 豆瓣:BYSocket Reprint it anywhere u want. 文章...
Writer:BYSocket(泥沙砖瓦浆木匠) 微博:BYSocket 豆瓣:BYSocket Reprint it anywhere u want. 文章...
http://blog.jobbole.com/79252/ 引言 NOKIA 有句著名的广告语:“科技以人为本”。任何技术都是为了满...
(点击上方公众号,可快速关注) 公众号:smart_android 作者:耿广龙|loonggg 点击“阅读原文”,可查看...
一、xml与xslt 相信所有人对xml都不陌生,其被广泛的应用于数据数据传输、保存与序列化中,是一种极为强...